nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1From 64e5c63ef72ab97ecae6d43845634aa34da0b426 Mon Sep 17 00:00:00 2001
2From: Yureka <yuka@yuka.dev>
3Date: Sun, 11 Jan 2026 16:49:07 +0100
4Subject: [PATCH] getopt.{c,h}: Do not use unspecified signatures
5
6Unspecified signatures no longer work with C23, and the GNU getopt signature matches the one specified by POSIX
7---
8 src/getopt.c | 2 +-
9 src/getopt.h | 7 -------
10 2 files changed, 1 insertion(+), 8 deletions(-)
11
12diff --git a/src/getopt.c b/src/getopt.c
13index 9bafa45..c268441 100644
14--- a/src/getopt.c
15+++ b/src/getopt.c
16@@ -209,7 +209,7 @@ static char *posixly_correct;
17 whose names are inconsistent. */
18
19 #ifndef getenv
20-extern char *getenv ();
21+extern char *getenv (const char *);
22 #endif
23
24 static char *
25diff --git a/src/getopt.h b/src/getopt.h
26index a1b8dd6..0aea224 100644
27--- a/src/getopt.h
28+++ b/src/getopt.h
29@@ -138,14 +138,7 @@ struct option
30 `getopt'. */
31
32 #if (defined __STDC__ && __STDC__) || defined __cplusplus
33-# ifdef __GNU_LIBRARY__
34-/* Many other libraries have conflicting prototypes for getopt, with
35- differences in the consts, in stdlib.h. To avoid compilation
36- errors, only prototype getopt for the GNU C library. */
37 extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
38-# else /* not __GNU_LIBRARY__ */
39-extern int getopt ();
40-# endif /* __GNU_LIBRARY__ */
41
42 # ifndef __need_getopt
43 extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
44--
452.52.0
46