Allowing C99 standard
Julien ÉLIE
julien at trigofacile.com
Fri Sep 4 10:12:50 UTC 2026
Hi all,
I suggest to change the current requirement that "all INN code should be
written expecting ANSI C" (aka C89) to C99. Modern compilers support
C99 and I doubt we have still users of very old platforms without a
C99-compliant compiler.
The rationale is that trying to build INN with -std=c89 already fails:
innd/python.c and nnrpd/python.c cannot be built with Python 3.13 (for
instance). There are tons of errors coming from Python headers, like:
/usr/include/python3.13/cpython/pyatomic.h:96:8: error: unknown type
name ‘inline’
/usr/include/python3.13/object.h:321:26: error: expected ‘=’, ‘,’, ‘;’,
‘asm’ or ‘__attribute__’ before ‘Py_REFCNT’
etc.
Builds fine with -std=c99.
Apart from Python, a few other files do not build with C89. They could
easily be fixed though, some of them are even only in CURRENT (not
released), but we can keep them as-is if we build with C99. Examples:
commands.c:250:5: error: C++ style comments are not allowed in ISO C90
250 | // strlcpy(PERMpass, fields[3], sizeof(PERMpass));
hissqlite/hissqlite.c:823:9: error: 'for' loop initial declarations are
only allowed in C99 or C11 mode
823 | for (size_t i = 0; writing && ok && i < n; i++) {
| ^~~
Also, it would permit the use of types like "unsigned long long"
(without checking its availability and switching to "unsigned long"
otherwise, which may not be sufficient), the %zu format specifier for
size_t instead of casting it to "unsigned long" and using %lu, and maybe
other things.
--
Julien ÉLIE
« La libertad, Sancho, es uno de los más preciosos dones que a los
hombres dieron los cielos; con ella no pueden igualarse los tesoros
que encierran la tierra y el mar: por la libertad, así como por la
honra, se puede y debe aventurar la vida. » (Miguel de Cervantes
Saavedra)
More information about the inn-workers
mailing list