Environment
- Commit:
064b5144f868c9359082cdeb39ac23a76a68728b
- OS: Fedora 44
- Compiler: GCC 16.1.1
- Architecture: x86_64
Description
A clean checkout fails to build with the default GCC 16 configuration on Fedora 44.
The build reports many errors of the form:
error: too many arguments to function 'HashKill'; expected 0, have 1
../utils/hash.h:107: note: declared here
extern void HashKill();
along with many similar errors such as:
error: number of arguments doesn't match prototype
error: conflicting types for ...
error: too many arguments to function ...
These occur across multiple modules (database, graphics, extract, commands, netmenu, etc.).
Steps to reproduce
git clone https://github.com/RTimothyEdwards/magic.git
cd magic
./configure
make -j$(nproc)
Result is the build fails with prototype mismatch errors.
Workaround
A simple workaround is
CFLAGS="-std=gnu17" ./configure
make -j$(nproc)
and it builds successfully.
From what I can tell, this appears to be related to GCC 15+ defaulting to gnu23, where empty parameter-list declarations (for example extern void Foo();) are interpreted differently than under previous defaults, exposing legacy K&R-style declarations throughout the codebase.
Question
Would you prefer a contribution that:
- Adds a temporary build-system workaround (for example using
-std=gnu17 where appropriate), or
- Modernizes the old-style declarations/prototypes so the project builds cleanly under newer GCC defaults?
I'd be happy to work on this issue whichever direction you prefer. Thanks!
Environment
064b5144f868c9359082cdeb39ac23a76a68728bDescription
A clean checkout fails to build with the default GCC 16 configuration on Fedora 44.
The build reports many errors of the form:
along with many similar errors such as:
These occur across multiple modules (database, graphics, extract, commands, netmenu, etc.).
Steps to reproduce
Result is the build fails with prototype mismatch errors.
Workaround
A simple workaround is
and it builds successfully.
From what I can tell, this appears to be related to GCC 15+ defaulting to
gnu23, where empty parameter-list declarations (for exampleextern void Foo();) are interpreted differently than under previous defaults, exposing legacy K&R-style declarations throughout the codebase.Question
Would you prefer a contribution that:
-std=gnu17where appropriate), orI'd be happy to work on this issue whichever direction you prefer. Thanks!