Invalid C99 in source3/locking/brlock.c

Michael Adam obnox at samba.org
Thu Feb 19 01:16:05 MST 2015


On 2015-02-18 at 23:50 -0600, Albert Chin wrote:
> On Wed, Feb 18, 2015 at 11:48:26PM +0100, Michael Adam wrote:
> > 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?
> 
> Yes, you're correct. Thanks.

Ok. Do you want to create a git patch for this?
If you are not into git, I can do it for you.

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/20150219/bb7068a0/attachment.pgp>


More information about the samba-technical mailing list