On 06/11/2014 05:28 PM, Nikolai Kondrashov wrote:
On 06/11/2014 03:46 PM, Lukas Slebodnik wrote:
> On (11/06/14 14:52), Nikolai Kondrashov wrote:
>> On 06/11/2014 10:52 AM, Lukas Slebodnik wrote:
>>>> +declare -r DEBUG_CFLAGS="-O0 -g3"
>>> In my opinion, sssd should be built without optimisation only for code
>>> coverage. Some warnings are not visible without optimisation.
>>
>> Wouldn't optimization mess with Valgrind traces?
>> Should we maybe do a separate build just to detect warnings?
>>
> no.
> I am used to debugging optimized code. The same with valgrind.
> It is not so comfortable, but it is possible.
> Some bugs are caused by compiler optimisation and would not be catched by CI.
> You can use different CFLAGS for different task.
I don't have much experience reading Valgrind traces for code with
optimization enabled, so I can't say if this is justified. Perhaps we can
enable optimization for the start and then see how it goes. I would like to
hear opinions from others as well.
I tried running Valgrind on a build with -O0 and -O2 and then comparing the
results. I didn't see any serious differences in reports. Mostly missing stack
frames (due to inlining, I guess) and functions copied under suffixed name
(such as "constprop").
To me it doesn't look too bad, so unless anyone has anything against it, I'll
make "DEBUG" build use -O2. This will affect tests which run under Valgrind
and the "distcheck" target.
Thank you Lukas for the suggestion, I think it will be useful.
Now, I wonder, what we should do with warnings. So far, CI doesn't request any
specific warnings and doesn't do anything with the default ones if they
appear.
Shall we perhaps have a test that would fail if there are any warnings?
Shall we enable or disable some specific warnings?
Nick