[Bug c/67279] -fsanitize=undefined spurious error: initializer element is not constant

zeccav at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Aug 19 18:59:00 GMT 2015


--- Comment #2 from Vittorio Zecca <zeccav at gmail dot com> ---
UB = undefined behaviour?
Why then it is only signaled if "static" attribute is requested?
This is accepted:"int dec_1 = 1 << 31;"
Isn't UB as well if it is not static?
I believe gcc should deliver a warning, and then a "runtime error"
message at runtime.
In other words codes that compile with gcc should still compile with
This example comes from wine and it is annoying to recompile the codes
that exhibit
this error message.
Also, the message is misleading, it should say that the initializer is

More information about the Gcc-bugs mailing list