I'm trying to build procmail with a (strict)er C99 compiler, but the initmake and autoconf shell scripts (not GNU autoconf) look difficult to port. As far as I understand it, C sources like this one are a compiled: #include "includes.h" int main(){int i;i=1; i+=WIFEXITED(i); i+=WIFSTOPPED(i); i+=WEXITSTATUS(i); i+=WSIGTERM(i); return i;} And then a function is listed as unsupported if it it appears in a warning. Error messages cause the procedure to abort; the compiler exit status must be zero. This doesn't work in strict C99 mode because the compilation fails; we do not have WSIGTERM in this example. There doesn't seem to be an upstream project around anymore. Also raised on the c-std-porting list: Porting procmail to C99 <https://lore.kernel.org/c-std-porting/87fse6ka12.fsf@oldenburg.str.redhat.com/T/>
Building in C89 mode like this works at least. Due to local patches, the build flags are injected properly. diff --git a/procmail.spec b/procmail.spec index 6767045..87c3653 100644 --- a/procmail.spec +++ b/procmail.spec @@ -54,8 +54,8 @@ forward certain incoming mail automatically to someone. find examples -type f | xargs chmod 644 %build -make RPM_OPT_FLAGS="$(getconf LFS_CFLAGS)" autoconf.h -make RPM_OPT_FLAGS="$RPM_OPT_FLAGS %{?hardened_flags} -Wno-comments $(getconf LFS_CFLAGS)" +make RPM_OPT_FLAGS="-std=gnu89 $(getconf LFS_CFLAGS)" autoconf.h +make RPM_OPT_FLAGS="$RPM_OPT_FLAGS -std=gnu89 %{?hardened_flags} -Wno-comments $(getconf LFS_CFLAGS)" %install rm -rf ${RPM_BUILD_ROOT}
Yes, the upstream seems dead. What's the point in compiling the package in Fedora in C89? Isn't the default Fedora C standard gnu18? For whatever reason you need it, isn't enough to just enforce the C89 standard to the detection code in the autoconf script? What benefit will it have for Fedora?
We want to stop providing support for obsolete language constructs in GCC by default if they are known to waste programmer time or are incompatible with future language evolution. That means that code which uses C89-only constructs that were removed from C89, it has to be ported to C99 or later, or built in C89 mode. There is no other way to disable these obsolete features by default. procmail doesn't use real autoconf, it has its own thing, which at least means we don't have to worry about autoreconf.
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle. Changing version to 38.