CI failure on account of C99

Douglas Bagnall douglas.bagnall at
Tue Apr 13 10:20:31 UTC 2021

On 13/04/21 9:34 pm, Philipp Gesang via samba-technical wrote:
>     ../../lib/util/tests/time.c:119:2: error: ‘for’ loop initial declarations are only allowed in C99 mode
>       for (int i = 0; i < sizeof(data) / sizeof(data[0]); ++i) {
>       ^
>     ../../lib/util/tests/time.c:119:2: note: use option -std=c99 or -std=gnu99 to compile your code
> AFAICS there’s numerous C99 constructs all over the source and
> README.Coding explicitly mentions it. Is there a special
> precaution that must be taken for this test target to work?

The Samba style is to declare all the things first.

We work in a grey zone somewhere close to C99, which we enforce by making
our default compiler GCC-with-various-flags. What has happened is that the
GCC defaults have gradually become more and more C99- or C11- or C17-ish,
and our flags are no longer regressive enough to match our standards. So
now the only build that actually follows them is Centos 7.

When we leave Centos 7 behind we will either have to fiddle with compiler
options or drop this requirement. I personally don't mind which.


More information about the samba-technical mailing list