From: Niels Möller Date: Tue, 24 Jun 2025 18:41:41 +0000 (+0200) Subject: Fix non-prototype declarations in getopt files. X-Git-Tag: nettle_3.10.2_release_20250626~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d2d88588037edaf0f7795d90887f47b254c08d0;p=thirdparty%2Fnettle.git Fix non-prototype declarations in getopt files. --- diff --git a/ChangeLog b/ChangeLog index b1ab73ea..b57e153b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-06-24 Niels Möller + + Minimal patch for compilers that require prototypes, e.g., gcc-15. + * getopt.c (getenv): Delete non-prototype declaration. + * getopt.h (getopt): Declare getopt with a prototype, also for + non-glibc systems. + 2025-04-02 Niels Möller * configure.ac: For ppc64, check if __VSX__ is defined, and diff --git a/getopt.c b/getopt.c index 9d29de7c..6d1c9218 100644 --- a/getopt.c +++ b/getopt.c @@ -129,17 +129,6 @@ int optopt = '?'; static struct _getopt_data getopt_data; - -#ifndef __GNU_LIBRARY__ - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -#ifndef getenv -extern char *getenv (); -#endif - -#endif /* not __GNU_LIBRARY__ */ #ifdef _LIBC /* Stored original parameters. diff --git a/getopt.h b/getopt.h index da1a01ff..da812bc9 100644 --- a/getopt.h +++ b/getopt.h @@ -166,7 +166,7 @@ extern int __posix_getopt (int ___argc, char *const *___argv, # endif # endif #else /* not __GNU_LIBRARY__ */ -extern int getopt (); +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); #endif /* __GNU_LIBRARY__ */ #ifndef __need_getopt