Re:Boringcc: Proposal for a C compiler for secure software
by klodolph on Monday December 21, 2015 @04:07PM
(#10773516)
Dereferencing NULL, in a C program, is ALWAYS undefined behavior. The fact that you are using a Cortex-M processor does not change this fact. It is spelled out very clearly in the C standard.
[ Parent
| on HN ]
Re:Boringcc: Proposal for a C compiler for secure software
by silon7 on Tuesday December 22, 2015 @03:03AM
(#10776465)
I've used at times it to crash the program (core dump), producing a cleaner stack than abort().
Re:Boringcc: Proposal for a C compiler for secure software
by astrange on Tuesday December 22, 2015 @06:28AM
(#10777090)
You should use __builtin_trap(). Invoking undefined behavior lets the compiler justifiably delete the entire code path leading up to it.
Re:Boringcc: Proposal for a C compiler for secure software
by masklinn on Monday December 21, 2015 @05:17PM
(#10773951)
> Dereferencing NULL, in a C program, is ALWAYS undefined behavior.
1. you're not required to use C
2. an extension to the C standard can decide to define that behaviour