Re:GNU Coding Standards: Writing Robust Programs
by mhh__ on Friday June 11, 2021 @08:47AM
(#27472551)
Which checks will the compiler remove? If you haven't invoked undefined behaviour then that should be a bug in the compiler
[ Parent
| on HN ]
Re:GNU Coding Standards: Writing Robust Programs
by MaxBarraclough on Friday June 11, 2021 @09:44AM
(#27473221)
They might be thinking of cases like where C compilers can remove code that zeroes memory holding security-sensitive data. [0][1] The compiler is permitted to reason that this memory is about to be deallocated anyway, so we can elide the memset call.
I can't imagine why a C compiler would remove a non-trivial runtime check though (except undefined behaviour).
[0] https://wiki.sei.cmu.edu/confluence/display/c/MSC06-C.+Bewar...