From a9b59370155fdc03341ef784d9948c27fcb8f810 Mon Sep 17 00:00:00 2001 From: Shine <4c.fce2@proton.me> Date: Mon, 2 Feb 2026 23:06:44 +0100 Subject: [PATCH] tools: bc: fix build on musl host 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 --- tools/bc/patches/001-getopt-declaration.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tools/bc/patches/001-getopt-declaration.patch diff --git a/tools/bc/patches/001-getopt-declaration.patch b/tools/bc/patches/001-getopt-declaration.patch new file mode 100644 index 00000000000..c64be8dc032 --- /dev/null +++ b/tools/bc/patches/001-getopt-declaration.patch @@ -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__ */ -- 2.47.3