Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libnfs: fix build with gcc >= 14
@ 2024-07-27  8:42 Fabrice Fontaine
  2024-07-27 14:09 ` Thomas Petazzoni via buildroot
  2024-09-01  8:54 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2024-07-27  8:42 UTC (permalink / raw)
  To: buildroot; +Cc: Fabrice Fontaine

Fix the following build failure with gcc >= 14 which enables
-Werror=implicit-function-declaration
(https://gcc.gnu.org/gcc-14/porting_to.html):

nfs-stat.c: In function 'main':
nfs-stat.c:287:30: error: implicit declaration of function 'ctime' [-Wimplicit-function-declaration]
  287 |         printf("Access: %s", ctime( (const time_t *) &st.nfs_atime));
      |                              ^~~~~
nfs-stat.c:177:1: note: 'ctime' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
  176 | #include <pwd.h>
  +++ |+#include <time.h>
  177 | char *uid_to_name(int uid)

Fixes:
 - http://autobuild.buildroot.org/results/73c3828a4e5d275ca0dfdd5b314494e2b00393c8

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...0002-utils-nfs-stat.c-include-time.h.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/libnfs/0002-utils-nfs-stat.c-include-time.h.patch

diff --git a/package/libnfs/0002-utils-nfs-stat.c-include-time.h.patch b/package/libnfs/0002-utils-nfs-stat.c-include-time.h.patch
new file mode 100644
index 0000000000..649d84524c
--- /dev/null
+++ b/package/libnfs/0002-utils-nfs-stat.c-include-time.h.patch
@@ -0,0 +1,39 @@
+From 034205b6b3acd64f9c75010d8da27e2c9f1bc82f Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Sun, 21 Jul 2024 18:04:05 +0200
+Subject: [PATCH] utils/nfs-stat.c: include time.h
+
+Include time.h to fix the following build failure with gcc >= 14 which
+enables -Werror=implicit-function-declaration
+(https://gcc.gnu.org/gcc-14/porting_to.html):
+
+nfs-stat.c: In function 'main':
+nfs-stat.c:287:30: error: implicit declaration of function 'ctime' [-Wimplicit-function-declaration]
+  287 |         printf("Access: %s", ctime( (const time_t *) &st.nfs_atime));
+      |                              ^~~~~
+nfs-stat.c:177:1: note: 'ctime' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
+  176 | #include <pwd.h>
+  +++ |+#include <time.h>
+  177 | char *uid_to_name(int uid)
+
+Fixes:
+ - http://autobuild.buildroot.org/results/73c3828a4e5d275ca0dfdd5b314494e2b00393c8
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://github.com/sahlberg/libnfs/commit/39e1ae0206fb519c551b48b0e6de57f3e764e886
+---
+ utils/nfs-stat.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/utils/nfs-stat.c b/utils/nfs-stat.c
+index 17ddb311..0ec33544 100644
+--- a/utils/nfs-stat.c
++++ b/utils/nfs-stat.c
+@@ -50,6 +50,7 @@ WSADATA wsaData;
+ #include <inttypes.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
++#include <time.h>
+ #include "libnfs.h"
+ #include "libnfs-raw.h"
+ #include "libnfs-raw-mount.h"
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/libnfs: fix build with gcc >= 14
  2024-07-27  8:42 [Buildroot] [PATCH 1/1] package/libnfs: fix build with gcc >= 14 Fabrice Fontaine
@ 2024-07-27 14:09 ` Thomas Petazzoni via buildroot
  2024-09-01  8:54 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-07-27 14:09 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

On Sat, 27 Jul 2024 10:42:48 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure with gcc >= 14 which enables
> -Werror=implicit-function-declaration
> (https://gcc.gnu.org/gcc-14/porting_to.html):
> 
> nfs-stat.c: In function 'main':
> nfs-stat.c:287:30: error: implicit declaration of function 'ctime' [-Wimplicit-function-declaration]
>   287 |         printf("Access: %s", ctime( (const time_t *) &st.nfs_atime));
>       |                              ^~~~~
> nfs-stat.c:177:1: note: 'ctime' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
>   176 | #include <pwd.h>
>   +++ |+#include <time.h>
>   177 | char *uid_to_name(int uid)
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/73c3828a4e5d275ca0dfdd5b314494e2b00393c8
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  ...0002-utils-nfs-stat.c-include-time.h.patch | 39 +++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 package/libnfs/0002-utils-nfs-stat.c-include-time.h.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/libnfs: fix build with gcc >= 14
  2024-07-27  8:42 [Buildroot] [PATCH 1/1] package/libnfs: fix build with gcc >= 14 Fabrice Fontaine
  2024-07-27 14:09 ` Thomas Petazzoni via buildroot
@ 2024-09-01  8:54 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-09-01  8:54 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure with gcc >= 14 which enables
 > -Werror=implicit-function-declaration
 > (https://gcc.gnu.org/gcc-14/porting_to.html):

 > nfs-stat.c: In function 'main':
 > nfs-stat.c:287:30: error: implicit declaration of function 'ctime' [-Wimplicit-function-declaration]
 >   287 |         printf("Access: %s", ctime( (const time_t *) &st.nfs_atime));
 >       |                              ^~~~~
 > nfs-stat.c:177:1: note: 'ctime' is defined in header '<time.h>'; this is probably fixable by adding '#include <time.h>'
 >   176 | #include <pwd.h>
 >   +++ |+#include <time.h>
 >   177 | char *uid_to_name(int uid)

 > Fixes:
 >  - http://autobuild.buildroot.org/results/73c3828a4e5d275ca0dfdd5b314494e2b00393c8

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

Committed to 2024.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-09-01  8:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-27  8:42 [Buildroot] [PATCH 1/1] package/libnfs: fix build with gcc >= 14 Fabrice Fontaine
2024-07-27 14:09 ` Thomas Petazzoni via buildroot
2024-09-01  8:54 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox