[PATCH] Fix the O3 developer build

Richard Sharpe realrichardsharpe at gmail.com
Mon Mar 16 16:38:00 MDT 2015


On Mon, Mar 16, 2015 at 3:17 PM, Stefan (metze) Metzmacher
<metze at samba.org> wrote:
> Am 16.03.2015 um 07:47 schrieb Volker Lendecke:
>> On Sun, Mar 15, 2015 at 10:53:07PM +0100, Stefan (metze) Metzmacher wrote:
>>> Hi Volker,
>>>
>>>> Review&push appreciated!
>>>
>>> Can you split this into two commits?
>>>
>>> I'd also prefer '{}' instead of '{0}'.
>>>
>>> It seems '{0}' is not needed in the variable declaration.
>>
>> I'm not sure about that. I'd love to see the relevant
>> sections of the C standard before I am convinced. Do you
>> have pointers to that?
>
> No. This is just what I learned from syntax error in
> source3/locking/brlock.c
> thread.

This document: http://stackoverflow.com/questions/10828294/c-and-c-partial-initialization-of-automatic-structure

says:

"C99 Standard 6.7.8.21

If there are fewer initializers in a brace-enclosed list than there
are elements or members of an aggregate, or fewer characters in a
string literal used to initialize an array of known size than there
are elements in the array, the remainder of the aggregate shall be
initialized implicitly the same as objects that have static storage
duration."

Of course, I have not looked at the actual C99 Standard.

> Thomas: Does struct torture_lease_break break_info_tmp = {}; work?
>
>> Until then, I'll keep the patches
>> private, so that others are not bothered.
>>
>>> I'm also wondering if we should use -O3 for samba-ctdb in
>>> autobuild. The attached patch should do that, but it's not tested yet.
>>
>> That won't help much. Different gcc versions on different
>> platforms complain about different situations.
>
> Sure, but preventing at least the common warnings seems to be better
> than preventing none.
>
>> Attached find the uncontroversial part re-submitted.
>
> Pushed.
>
> Thanks!
> metze
>



-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)


More information about the samba-technical mailing list