mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-20 03:47:16 +02:00
https://lists.gnu.org/archive/html/info-gnu/2025-01/msg00000.html also, fix build with gcc 15 as a result of C23 treating unprototyped functions as taking no arguments (void)
28 lines
841 B
Diff
28 lines
841 B
Diff
--- a/h/getopt.h
|
|
+++ b/h/getopt.h
|
|
@@ -135,14 +135,10 @@
|
|
arguments to the option '\0'. This behavior is specific to the GNU
|
|
`getopt'. */
|
|
|
|
-#ifdef __GNU_LIBRARY__
|
|
/* Many other libraries have conflicting prototypes for getopt, with
|
|
differences in the consts, in stdlib.h. To avoid compilation
|
|
errors, only prototype getopt for the GNU C library. */
|
|
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts);
|
|
-#else /* not __GNU_LIBRARY__ */
|
|
-extern int getopt ();
|
|
-#endif /* __GNU_LIBRARY__ */
|
|
|
|
#ifndef __need_getopt
|
|
extern int getopt_long (int ___argc, char *const *___argv,
|
|
--- a/lib/getopt.c
|
|
+++ b/lib/getopt.c
|
|
@@ -197,7 +197,7 @@
|
|
whose names are inconsistent. */
|
|
|
|
#ifndef getenv
|
|
-extern char *getenv ();
|
|
+extern char *getenv (const char *);
|
|
#endif
|
|
|
|
#endif /* not __GNU_LIBRARY__ */
|