Optimization I'd like to see compilers be able to make: if (strlen(s)>100) -> if (strnlen(s,101)>100)
It's possible there is, but if so this code is broken. The compiler is free to optimize out dead loads, which is ultimately what this is (if you think of it as inlining and unrolling the strlen).
-
-
Cut to 2028: committee fixes this “bug” by making all string functions take volatile pointers.
-
2029: volatile pointers to volatile contents
-
static volatile functions will solve this problem
-
There is talk of constexpr volatile.
- End of conversation
New conversation -
-
-
and again, LLVM (and I assume gcc) is already doing a lot of similar optimizations, this one would be unlikely to change the situation
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
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.
