[PATCH] kconfig/lxdialog: fix check sample for gcc14
Alexis Lothoré
alexis.lothore at bootlin.com
Wed Oct 9 21:49:51 UTC 2024
Trying to execute "make menuconfig" with GCC 14 fails with the following
error, despite ncurses being installed on the host:
*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
make[2]: *** [[...]/scripts/kconfig/lxdialog/Makefile:15: scripts/kconfig/lxdialog/dochecklxdialog] Error 1
make[1]: *** [[...]/scripts/kconfig/Makefile:14: menuconfig] Error 2
The failure is due to a silenced error in check-lxdialog.sh during the
check step:
<stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
Fix the sample main function definition to fix menuconfig with recent
compilers
Closes: https://bugs.busybox.net/show_bug.cgi?id=16186
Signed-off-by: Alexis Lothoré <alexis.lothore at bootlin.com>
---
The issue has affected some other projects like Buildroot, which has
received the same kind of fix:
https://lore.kernel.org/buildroot/20240408213807.GA44146@pevik/T/#m865c15c74597fe43fd95fd75dc9f3f26887328bf
And picking an upstream fix is not an option since the corresponding
upstream project (the linux kernel) has issued many reworks on lxdialog
and so does not use check-lxdialog.sh anymore
---
scripts/kconfig/lxdialog/check-lxdialog.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 5075ebf2d3b9..4e138366d218 100755
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -47,7 +47,7 @@ trap "rm -f $tmp" 0 1 2 3 15
check() {
$cc -x c - -o $tmp 2>/dev/null <<'EOF'
#include CURSES_LOC
-main() {}
+int main() {}
EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2
--
2.46.2
More information about the busybox
mailing list