What makes you think so? I am aware of multiple implementations that add bounds checking. There is nothing in the standard that forces it to be unsafe.
What makes you think so? I am aware of multiple implementations that add bounds checking. There is nothing in the standard that forces it to be unsafe.
I didn't think such a thing was standards-compliant but I'm also not an expert on the standard.
I use the following safety arguments in gcc 6.2.1: -fsanitize=undefined -fsanitize=address -fno-omit-frame-pointer -D_FORTIFY_SOURCE=1
I am also aware of https://staff.aist.go.jp/y.oiwa/FailSafeC/index-en.html, http://www.seclab.cs.sunysb.edu/mscc/, http://compcert.inria.fr/compcert-C.html and http://pages.cs.wisc.edu/~austin/scc.html
That doesn't mean that I think static analysis tooling is bad, or invalid or something!
(I forgot about CompCert, but I've never run across any of the other ones in the wild.)
Besides, gcc and clang are just two of many C compilers.
Nobody claimed that they were. I only mentioned that there are C implementations that protect against these kinds of things in the runtime and that the standard does not force the implementation to not do any checks.
> Besides, gcc and clang are just two of many C compilers.
The reason that I mentioned them was because they are two most popular ones.
Also, unless you're talking specifically about CompCert's interpreter, I don't think CompCert does what you think it does. The compiler is a verified implementation of the standard, but that, by definition, doesn't say anything about how it handles undefined behaviour.