[Snowball-discuss] C compiler requirements
Olly Betts
olly at survex.com
Mon Nov 9 05:02:57 GMT 2020
We've been aiming to keep Snowball completely usable with an ISO C90
compiler. This results in a fair amount of extra maintainer work asking
people to eliminate C99 features from patches, or fixing up patches
before applying them.
And this arguably makes the code worse - e.g. being able to declare a
variable at the point where you can assign a value avoids the
possibility of using it uninitialised, and snprintf() helps avoid buffer
overflows.
I've concluded trying to enforce C90 isn't really a good use of my time,
nor of the time of people contributing patches. I added a CI build
earlier this year which passes options to GCC and clang to error out on
non-C90 code, but PR submitters don't seem to get notified of these
failures, so it doesn't automate very much of the problem away.
C99 is more than 20 years old now and all the common compilers support
it (Microsoft's offering didn't for many years, but I think C99 features
being incorporated into C++11 finally forced them to address that)
so I've decided to now require a C99 compiler to build the snowball
compiler.
For the time being, I'm intending to try to keep the generated C code
and the runtime support in the C libstemmer building with a C90
compiler. That means people can run "make dist" on (say) a modern Linux
machine to create libstemmer_c.tgz, and then build that on their
esoteric target with an ancient compiler.
I'd also like to hear from anyone actually needing C90 support still,
or (since I know only a small fraction of users read this list) anyone
who even just knows of an actual situation where C90 is still needed
(even if they aren't actually using snowball there).
Cheers,
Olly
More information about the Snowball-discuss
mailing list