]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Fix non-prototype declarations in getopt files. getopt-prototype
authorNiels Möller <nisse@lysator.liu.se>
Tue, 24 Jun 2025 18:41:41 +0000 (20:41 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Tue, 24 Jun 2025 18:41:41 +0000 (20:41 +0200)
ChangeLog
getopt.c
getopt.h

index b1ab73ea90264a0dc31f50bfa90efa90ea498d7f..b57e153b8a5a1950773b4bebed18e0ed37bbb88d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-06-24  Niels Möller  <nisse@lysator.liu.se>
+
+       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  <nisse@lysator.liu.se>
 
        * configure.ac: For ppc64, check if __VSX__ is defined, and
index 9d29de7c5ab1060864e94f5d7f447b0c25672d3d..6d1c9218d722bbceb431f0b576ef6bf2caeedcb4 100644 (file)
--- a/getopt.c
+++ b/getopt.c
@@ -129,17 +129,6 @@ int optopt = '?';
 
 static struct _getopt_data getopt_data;
 
-\f
-#ifndef __GNU_LIBRARY__
-
-/* Avoid depending on library functions or files
-   whose names are inconsistent.  */
-
-#ifndef getenv
-extern char *getenv ();
-#endif
-
-#endif /* not __GNU_LIBRARY__ */
 \f
 #ifdef _LIBC
 /* Stored original parameters.
index da1a01ffa86b2764b2352f7c941da0d5cb03e408..da812bc974dfb1d12a2ba2ef3ccd349c7b938187 100644 (file)
--- 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