Re: Reminder: advanced compiler novelties are upon us


Vinicius Costa Gomes
 

Hi,

Szymon Janc <szymon.janc@codecoup.pl> writes:

Hi,

(resending to mailing list)

On Friday, 31 March 2017 10:21:21 CEST Marcus Shawcroft wrote:
On 31 March 2017 at 08:33, Jukka Rissanen

<jukka.rissanen@linux.intel.com> wrote:
I think we should set the -fno-delete-null-pointer-checks as Szymon
commented in other reply.
We should understand the code size implication of that decision before
changing the out of box behaviour.

Another option might be to have a test compile run against each
submitted patch with:
-Wnull-dereference -fno-delete-null-pointer-checks -Werror
-Wnull-dereference has effect only if -fdelete-null-pointer-checks is set

So we could either make GCC warn when it is eliminating code under NULL check
or tell it to not eliminate that code at all (and thus get no
warning).
Adding the warnings, I think, is the best way forward.

Keeping the checks after the NULL pointer is accessed gains us little,
we are already in undefined behaviour land.



--
pozdrawiam
Szymon Janc
_______________________________________________
Zephyr-devel mailing list
Zephyr-devel@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-devel

Cheers,
--
Vinicius

Join devel@lists.zephyrproject.org to automatically receive all group messages.