Invalid C99 in source3/locking/brlock.c

Michael Adam obnox at samba.org
Wed Feb 18 15:48:26 MST 2015


On 2015-02-18 at 16:30 -0600, Albert Chin wrote:
> source3/locking/brlock.c has the following code:
>         *br_lck = (struct byte_range_lock) {};
> 
> According to GCC -pedantic, this isn't standard-conforming (and the
> Sun C compiler doesn't like it either). GCC warns with "warning: ISO C
> forbids empty initializer braces". The fix is trivial. Just change to:
>         *br_lck = (struct byte_range_lock) {{0}};
> 
> This occurs in master and v4-2-test.

Thanks for your hint!

Wouldn't it rather be

	*br_lck = (struct byte_range_lock) { 0 };

instead of

	*br_lck = (struct byte_range_lock) {{0}};

i.e. one set of braces less?

Cheers - Michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20150218/f82881f0/attachment.pgp>


More information about the samba-technical mailing list