C23 function declaration needs arguments
The C23 standard requires function declarations to have the arguments specified, else (void) (zero arguments) is assumed.
This is a
breaking change
for code that didn’t use the best practice of specifying the argument types in the function declaration.
A real life
example
of upgrading a large project (Red Hat Linux) to C23 compliance is illustrative.
This change emphasizes the importance of adhering to recent C standards for clarity while maintaining compatibility with older language standards if possible.
Freezing the compiler version range (not necessarily the language standard) for project code is generally a costly long-term strategy as technical debt and developer frustration accumulate. Newer compilers keep adding debugging features and performance improvements.
Workaround
Until the C or C++ code can be brought up to compliance with recent language standards, a workaround is to specify in the buildsystem an old-enough (but not needlessly old) language standard. For example, in CMake:
set(CMAKE_C_STANDARD 11)or in Meson:
project('my_c_project', 'c',
default_options: ['c_std=c11'])