diff options
Diffstat (limited to 'meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch')
-rw-r--r-- | meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch b/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch new file mode 100644 index 0000000000..e006d797d3 --- /dev/null +++ b/meta/recipes-extended/which/which-2.21/0001-getopt-Fix-signature-of-getenv-function.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 16a1647fc26953fab659de5f55d4c0defdfb894f Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 22 Mar 2025 17:56:19 -0700 | ||
4 | Subject: [PATCH] getopt: Fix signature of getenv function | ||
5 | |||
6 | This happens on musl systems using GCC 15 | ||
7 | |||
8 | ../which-2.21/getopt.h:106:12: error: conflicting types for 'getopt'; have 'int(void)' | ||
9 | 106 | extern int getopt (); | ||
10 | | ^~~~~~ | ||
11 | |||
12 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/which-bugs/2025-03/msg00000.html] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | getopt.c | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | --- a/getopt.c | ||
19 | +++ b/getopt.c | ||
20 | @@ -209,7 +209,7 @@ static char *posixly_correct; | ||
21 | /* Avoid depending on library functions or files | ||
22 | whose names are inconsistent. */ | ||
23 | |||
24 | -char *getenv (); | ||
25 | +char *getenv (const char*); | ||
26 | |||
27 | static char * | ||
28 | my_index (str, chr) | ||
29 | --- a/getopt.h | ||
30 | +++ b/getopt.h | ||
31 | @@ -103,7 +103,7 @@ struct option | ||
32 | errors, only prototype getopt for the GNU C library. */ | ||
33 | extern int getopt (int argc, char *const *argv, const char *shortopts); | ||
34 | #else /* not __GNU_LIBRARY__ */ | ||
35 | -extern int getopt (); | ||
36 | +extern int getopt (int, char * const [], const char *); | ||
37 | #endif /* __GNU_LIBRARY__ */ | ||
38 | extern int getopt_long (int argc, char *const *argv, const char *shortopts, | ||
39 | const struct option *longopts, int *longind); | ||