jrincayc/ucblogo-code

Build failures with newer compilers (GCC 14, Clang 16 and later)

fweimer-rh opened this issue · 4 comments

I tried to get ucblogo ready for GCC 14, and encountered the following issues:

  • SIG_TAKES_ARG should be defined on GNU/Linux because it uses standard C signal handlers which receive the signal number as an argument. I expect that this is needed on all platforms these days, not just GNU/Linux.
  • The X11 code uses the checkX macro. This macro has a return; statement without a value. But the macro is used (indirectly, via prepare_to_draw) in functions that return a pointer. Not sure what the best way is to fix this.
  • In termcap_getter, the function termcap_putter in the call to tputs has the wrong type.

You can approximate newer compiler behavior with -Werror=implicit-int -Werror=implicit-function-declaration -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=return-type, although -Werror=return-type will flag some things as errors that GCC 14 will still accept by default. Current Clang releases have similar behavior.

Okay, the SIG_TAKES_ARG is easy to fix (and that by itself fixes the wxwidgets build). A possible solution for the X11 and termcap is to just not support them on GCC 14. (Tho' I will try and fix them as well.)

Fixes:

@fweimer-rh I think this is now fixed on the master branch (if you double check with gcc 14 let me know). I plan on making a new point release in the next few weeks that includes this and other fixes since 6.2.4

Thank you. I applied 30b1223 and d300824 to the Fedora package and could build it with GCC 14.