syntax error in source3/locking/brlock.c

Thomas Schulz schulz at adi.com
Tue Mar 10 19:19:27 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 fat=
> al error,
>>>>>> but I just tried the smaller patch. It applied cleanly and the re=
> sult
>>>>>> builds correctly. I do wonder about lines such as:
>>>>>>=20
>>>>>> +       struct torture_lease_break break_info_tmp =3D { { { { { 0=
>  } } } } };
>>>>>>=20
>>>>>> I am affraid that we are in danger of using up the world's supply=
>  of
>>>>>> braces. :-)
>>>>>=20
>>>>> Is Solaris happy with just {0}?
>>>>>=20
>>>>> Thanks,
>>>>>=20
>>>>> Volker
>>>>=20
>>>> 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 s=
> et
>>>> of braces might be needed, I just thought that those lines looked odd.
>>>>=20
>>>> I also just noticed that the small patch misses one instance in
>>>> source4/torture/smb2/util.c. The large patch had both of them.
>>>=20
>>> 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?
>>>=20
>>> source4/torture/smb2/util.c
>>>=20
>>> -       union smb_fileinfo q =3D {};
>>> +       union smb_fileinfo q =3D { 0 };
>>>=20
>>> source3/locking/brlock.c
>>>=20
>>> -       *br_lck =3D (struct byte_range_lock) {};
>>> +       *br_lck =3D (struct byte_range_lock) { 0 };
>>>=20
>>> Converting everything else to { 0 } should probably be deferred until
>>> gcc handles this without additional warnings.
>>>=20
>>> Christof
>>=20
>> 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
> 
> =66rom 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

Oh goodness! I was just thinking that I should open a Bug report and attach
the required part of the patch by Christof. I will do that tomorrow unless
I hear otherwise.

Tom Schulz
Applied Dynamics Intl.
schulz at adi.com


More information about the samba-technical mailing list