22-kconfig-lxdialog-fix-check-with-GCC14.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 3ae91337b53fa3ccf0bad7f181fcaf483fab22ee Mon Sep 17 00:00:00 2001
  2. From: Robert Marko <robimarko@gmail.com>
  3. Date: Wed, 3 Apr 2024 14:18:07 +0200
  4. Subject: [PATCH] kconfig/lxdialog: fix check() with GCC14
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. GCC14 now treats implicit int types as error so when check() from
  9. check-lxdialog.sh is called to check whether we can link against ncurses
  10. it will fail silently and the help text indicating to install ncurses is
  11. printed.
  12. However, this is not due to missing ncurses but once the stderr redirect
  13. to /dev/null is removed we can see the root cause:
  14. <stdin>:2:1: error: return type defaults to ‘int’ [-Wimplicit-int]
  15. So, in order for menuconfig to work with GCC14 lets just specify the
  16. return type of main() as int.
  17. Signed-off-by: Robert Marko <robimarko@gmail.com>
  18. Reviewed-by: Petr Vorel <petr.vorel@gmail.com>
  19. Tested-by: Petr Vorel <petr.vorel@gmail.com>
  20. ---
  21. kconfig/lxdialog/check-lxdialog.sh | 2 +-
  22. 1 file changed, 1 insertion(+), 1 deletion(-)
  23. diff --git a/kconfig/lxdialog/check-lxdialog.sh b/kconfig/lxdialog/check-lxdialog.sh
  24. index 16cd9a3186..27d6c30a57 100755
  25. --- a/kconfig/lxdialog/check-lxdialog.sh
  26. +++ b/kconfig/lxdialog/check-lxdialog.sh
  27. @@ -48,7 +48,7 @@ trap "rm -f $tmp" 0 1 2 3 15
  28. check() {
  29. $cc -x c - -o $tmp 2>/dev/null <<'EOF'
  30. #include CURSES_LOC
  31. -main() {}
  32. +int main() {}
  33. EOF
  34. if [ $? != 0 ]; then
  35. echo " *** Unable to find the ncurses libraries or the" 1>&2
  36. --
  37. 2.44.0