Re: Reminder: advanced compiler novelties are upon us

Vinicius Costa Gomes


Szymon Janc <> writes:


(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

<> 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
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.

Szymon Janc
Zephyr-devel mailing list


Join to automatically receive all group messages.