linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Schmidt <ryandesign@macports.org>
To: linux-ext4@vger.kernel.org
Subject: e2fsprogs 1.46.2 needs #include <time.h> in probe.c
Date: Sun, 11 Apr 2021 07:57:33 -0500	[thread overview]
Message-ID: <A283A764-EBEB-4273-92D4-FC26129745E4@macports.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

Hi,

I am the maintainer of e2fsprogs in MacPorts. The developer of e2fsprogs has asked me to report patches for his program to this mailing list.

e2fsprogs 1.46.2 does not build on macOS when implicit declaration of functions is considered an error. This condition can be achieved either by adding -Werror=implicit-function-declaration to CFLAGS when configuring or by compiling with the version of clang included with Xcode 12 or later on macOS in which that behavior is the default.

The error messages are:


probe.c:285:16: error: implicit declaration of function 'time' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        time_t          now = time(0);
                              ^
probe.c:1677:9: error: implicit declaration of function 'difftime' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        diff = difftime(now, dev->bid_time);
               ^
2 errors generated.


The fix is to #include <time.h> in probe.c per the attached patch.

This problem and the fix were reported to MacPorts against e2fsprogs 1.45.6 here: https://github.com/macports/macports-ports/pull/9137

Please Cc me on replies if you need further information.


[-- Attachment #2: patch-probe.c.diff --]
[-- Type: application/octet-stream, Size: 282 bytes --]

--- lib/blkid/probe.c	2020-11-15 14:19:10.000000000 -0500
+++ lib/blkid/probe.c.fixed	2020-11-15 14:21:25.000000000 -0500
@@ -17,6 +17,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <time.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <ctype.h>

             reply	other threads:[~2021-04-11 13:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-11 12:57 Ryan Schmidt [this message]
2021-04-11 23:58 ` e2fsprogs 1.46.2 needs #include <time.h> in probe.c Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A283A764-EBEB-4273-92D4-FC26129745E4@macports.org \
    --to=ryandesign@macports.org \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).