]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
tools: bc: fix build on musl host 21957/head
authorShine <4c.fce2@proton.me>
Mon, 2 Feb 2026 22:06:44 +0000 (23:06 +0100)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Sun, 21 Jun 2026 09:18:46 +0000 (11:18 +0200)
Fix declaration of getenv() in getopt.c

Backport from bc 1.08.2.

Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/21957
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
tools/bc/patches/001-getopt-declaration.patch [new file with mode: 0644]

diff --git a/tools/bc/patches/001-getopt-declaration.patch b/tools/bc/patches/001-getopt-declaration.patch
new file mode 100644 (file)
index 0000000..c64be8d
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/lib/getopt.c
++++ b/lib/getopt.c
+@@ -197,7 +197,7 @@ static char *posixly_correct;
+    whose names are inconsistent.  */
+ #ifndef getenv
+-extern char *getenv ();
++extern char *getenv (const char *);
+ #endif
+ #endif /* not __GNU_LIBRARY__ */