syntax error in source3/locking/brlock.c

Michael Adam obnox at samba.org
Tue Mar 10 15:26:53 MDT 2015


On 2015-03-10 at 14:15 -0400, Thomas Schulz wrote:
> > On Tue, Mar 10, 2015 at 11:09:54AM -0400, Thomas Schulz wrote:
> > > > On Mon, Mar 09, 2015 at 01:12:48PM -0400, Thomas Schulz wrote:
> > > > > It looks like we are only going the fix the one file with the fatal error,
> > > > > but I just tried the smaller patch. It applied cleanly and the result
> > > > > builds correctly. I do wonder about lines such as:
> > > > > 
> > > > > +       struct torture_lease_break break_info_tmp = { { { { { 0 } } } } };
> > > > > 
> > > > > I am affraid that we are in danger of using up the world's supply of
> > > > > braces. :-)
> > > > 
> > > > Is Solaris happy with just {0}?
> > > > 
> > > > Thanks,
> > > > 
> > > > Volker
> > > 
> > > I just tried it and just { 0 } makes the Solaris compiler happy.
> > > I am not a good enough C programmer to understand why more than one set
> > > of braces might be needed, I just thought that those lines looked odd.
> > > 
> > > I also just noticed that the small patch misses one instance in
> > > source4/torture/smb2/util.c. The large patch had both of them.
> > 
> > Based on the comments in this thread, i think we should just change the
> > instances that cause problems with the Solaris compiler. Can you confirm
> > that these are the required changes?
> > 
> > source4/torture/smb2/util.c
> > 
> > -       union smb_fileinfo q = {};
> > +       union smb_fileinfo q = { 0 };
> > 
> > source3/locking/brlock.c
> > 
> > -       *br_lck = (struct byte_range_lock) {};
> > +       *br_lck = (struct byte_range_lock) { 0 };
> > 
> > Converting everything else to { 0 } should probably be deferred until
> > gcc handles this without additional warnings.
> > 
> > Christof
> 
> Just the patch to source3/locking/brlock.c is required as that one is the
> only fatal error.

Agreed.

Interestingly, this bug was already discussed in this thread

https://lists.samba.org/archive/samba-technical/2015-February/105624.html

from Feb 18, and I proposed the same change in

https://lists.samba.org/archive/samba-technical/2015-February/105625.html

but the original reporter never came up with a git-patch
and I lost track of it.


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/20150310/cbcf6820/attachment.pgp>


More information about the samba-technical mailing list