3 ms·
I would hope none, since no static analysis tool can make that assumption without knowing the exact compiler you're thinking about and a great deal else. This
by unwind 9y ago
I would hope none, since no static analysis tool can make that assumption without knowing the exact compiler you're thinking about and a great deal else.
This is not the "expected" behavior; undefined behavior doesn't have an expected behavior. This is what the compiler at godbolt.com happens to generate for this particular code.
At best, an analysis tool can warn that the code has undefined behavior.
- justin66 9y ago> At best, an analysis tool can warn that the code has undefined behavior. The least obvious things, like undefined behavior, are exactly the sort of thing a static analysis tool should be expected to warn about.