Why does gcc not have a warning option for &x+k where x is an identifier or result of . or -> operator and k!=0,1 (!=0 if dereferenced)?
-
Show this thread
-
Oops, it does. -Warray-bounds. It's even included in -Wall and I had it on. Unfortunately it only works at -O2 and higher (-ftree-vrp) and I had -Os...
1 reply 0 retweets 2 likesShow this thread -
This is probably going to be the deciding factor that convinces me to kill the current musl default path-specific -Os/-O3 config and use -O2 by default for everything. Broken warnings are not fun.
1 reply 0 retweets 0 likesShow this thread -
Hm, nope. -Os includes it too. And it works on a minimal test case but not the case that I hit in real code in musl...
2 replies 0 retweets 1 likeShow this thread -
And here's the resulting bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87192 …
1 reply 0 retweets 0 likesShow this thread -
Replying to @RichFelker
Couldn't you just use an actual high level language, instead of C?
2 replies 0 retweets 0 likes -
Replying to @brouhaha
C is a high level language and even admits memory-safe implementations, and there are really few if any others that admit explicit-storage implementations.
1 reply 0 retweets 0 likes -
Replying to @RichFelker
I don't think it can be proven that a memory-safe C compiler/runtime implementation is even possible, let alone practical to construct or usable. Certainly it's possible to do a good bit better than GCC does, but that's not saying a lot.
1 reply 0 retweets 0 likes -
Replying to @brouhaha @RichFelker
A trivial example: in C, as soon as your program adds two arbitrary signed integers (perhaps read from input files), your program is not memory-safe.
1 reply 0 retweets 0 likes -
Replying to @brouhaha
That has nothing to do with memory safety; it's just UB and an implementation can make it go away by defining the result.
1 reply 0 retweets 0 likes
The hard UBs to eliminate are data races, use after free, aliasing issues.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.