-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes for C99 compatibility #100
base: master
Are you sure you want to change the base?
Conversation
Implicit ints have not been part of C since 1999, and future compilers will disable support for them by default. Fortunatenly, only one configure check needs adjusting.
Otherwise, the check fails on a compiler which does not support implicit function declarations (a language feature removed in 1999).
Incompatible pointer types are actually errors (in the sense that they are invalid C). Compilers have merely tolerated them as warnings for backwards compatibility. This is changing with Clang 16 and GCC 14, so relax the check a little.
Do not check that the compiler supports implicit ints without errors. Add a missing #include <unistd.h>. Submitted upstream: <fvwmorg#100> Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
Incompatible pointer types are actually errors (in the sense that they are invalid C). Compilers have merely tolerated them as warnings for backwards compatibility. This is changing with Clang 16 and GCC 14, so relax the check a little. Submitted upstream: <fvwmorg#100> Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
In support of this PR: In Archlinux (currently GCC 14.1), FVWM did not build anymore, due to these warnings now being marked as errors. I was able to build FVWM by adding the following CFLAGS during configure: "-Wno-error=int-conversion -Wno-error=incompatible-pointer-types". See also the this post on Archlinux forums. |
Note, fvwm is no longer supported, 2.7.0 is the final release. It will probably be up to maintainers to either have local patches or fixes from here on out to keep fvwm building. Though keeping PRs like this open can help users find ways to fix issues they run into. (note maybe if enough of these pile up we might merge them). |
Perfect, I used local patches. Definitely grateful for PRs as they do help to fix issues. |
This will allow building with compilers that diagnose some C99 constraint violations as errors instead of warnings.