On Wed, Feb 8, 2017 at 8:37 PM, Nicolai Hähnle <[email protected]> wrote:
> On 08.02.2017 20:17, Marek Olšák wrote:
>>
>> The no_sanitize attribute seems to be the most acceptable approach.
>
>
> I disagree. gcc produces the same code even with just -O, and the ?: version
> very clearly avoids undefined behavior. If we could get into the habit of
> regularly running tests with the various sanitizers enabled, it would
> definitely allow us to catch some bugs sooner.
>
> Though the example Bartosz produced is still overly conservative, the "safe"
> code still has an unnecessary `if (pptr)` (which gcc actually optimizes away
> based on the fact that pptr was previously dereferenced...).

OK whatever. No hard feelings.

Marek
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to