Linux-ext4 Archive on lore.kernel.org
 help / color / Atom feed
* e2fsprogs 1.46.2 needs #include <time.h> in probe.c
@ 2021-04-11 12:57 Ryan Schmidt
  2021-04-11 23:58 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Ryan Schmidt @ 2021-04-11 12:57 UTC (permalink / raw)
  To: linux-ext4


[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: e2fsprogs 1.46.2 needs #include <time.h> in probe.c
  2021-04-11 12:57 e2fsprogs 1.46.2 needs #include <time.h> in probe.c Ryan Schmidt
@ 2021-04-11 23:58 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2021-04-11 23:58 UTC (permalink / raw)
  To: Ryan Schmidt; +Cc: linux-ext4

On Sun, Apr 11, 2021 at 07:57:33AM -0500, Ryan Schmidt wrote:
> 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.

Hi Ryan,

Thanks for the bug report and proposed fix.  I've applied it to the
e2fsprogs git tree.

Cheers,

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-11 12:57 e2fsprogs 1.46.2 needs #include <time.h> in probe.c Ryan Schmidt
2021-04-11 23:58 ` Theodore Ts'o

Linux-ext4 Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-ext4/0 linux-ext4/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-ext4 linux-ext4/ https://lore.kernel.org/linux-ext4 \
		linux-ext4@vger.kernel.org
	public-inbox-index linux-ext4

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-ext4


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git