syntax error in source3/locking/brlock.c

Thomas Schulz schulz at adi.com
Fri Mar 6 16:17:19 MST 2015


> On Fri, Mar 06, 2015 at 01:54:38PM -0700, Christof Schmitt wrote:
>> On Fri, Mar 06, 2015 at 09:41:19PM +0100, Volker Lendecke wrote:
>>> On Fri, Mar 06, 2015 at 01:35:31PM -0700, Christof Schmitt wrote:
>>>> On Fri, Mar 06, 2015 at 01:26:43PM -0500, Thomas Schulz wrote:
>>>>> I have been building 4.2.0 on Solaris 10 using the GNU C compiler. I decided
>>>>> to see what happens with Sun's C 5.11 SunOS_i386 compiler. It complains
>>>>> with the following error:
>>>>> 
>>>>> "../source3/locking/brlock.c", line 2008: syntax error before or at: }
>>>>> cc: acomp failed for ../source3/locking/brlock.c
>>>>> 
>>>>> The offending line is:
>>>>> 
>>>>>         *br_lck = (struct byte_range_lock) {};
>>>>> 
>>>>> The GNU C compiler thinks that this line is OK. Does anyone have an
>>>>> idea what is intended here and why the Sun compiler does not like it?
>>>> 
>>>> Try changing this to:
>>>> 	*br_lck = (struct byte_range_lock) { 0 };
>>>> 
>>>> I think that strictly speaking C, does not allow omitting the 0, but C++
>>>> compatible compilers allow it. With -pedantic, gcc also warns about
>>>> this:  warning: ISO C forbids empty initializer braces
>>> 
>>> Yep.
>>> 
>>> $ git grep '{}'|grep c:|wc -l
>>> 153
>>> 
>>> That would be a 153-line patch I guess. Or you can gain 153
>>> ohloh-points with single patches :-)
>> 
>> It might be even less than 153 patches, there also some empty code
>> blocks in there. Let me try to put a patch together, having single
>> patches would be too much overhead.
> 
> The diffstat now shows 124 lines, see attached patch. Would be it
> possible to compile test master with this patch with the SunOS compiler,
> to see whether there are other issues remaining?
> 
> Christof

I got 4.2.0 to finish building by changing just that one line in
brlock.c. Unless  the master has a lot more of those than 4.2.0,
building the master probably will not check most of the big patch.

Tom Schulz
Applied Dynamics Intl.
schulz at adi.com


More information about the samba-technical mailing list