Can we move Samba to C99 and past -Werror=declaration-after-statement ?

Joseph Sutton jsutton at
Fri Nov 10 00:13:44 UTC 2023

On 10/11/23 11:13 am, Martin Schwenke via samba-technical wrote:
> On Fri, 10 Nov 2023 10:58:04 +1300, Andrew Bartlett via samba-technical
> <samba-technical at> wrote:
>> Samba chooses to, for it's C style guide, to enforce -
>> Werror=declaration-after-statement
>> I understand that some prefer the style.
>> However C has moved on as a language, and libraries we use (Python 3.12
>> in this case) don't compile with it, and we are having to do quite some
>> contortions in
>> to build on
>> Fedora 39.
>> See also discussion at
>> Can we agree to just remove this requirement?
>> It will allow us to keep variables closer to their use, which is
>> helpful in a lot of ways, particularly in longer functions.
> I think that sounds good.  Yes from me.
> Can we also please declare for loop variable in the loop?
> peace & happiness,
> martin

I am also in favour of removing this restriction. Among other practical 
benefits, being able to assign to and declare variables in one statement 
will make ‘const’ much more useful for guarding against inadvertent 


More information about the samba-technical mailing list