[Bug sanitizer/71611] UBSan shows type '<unknown>' for enums based on long

ch3root at openwall dot com gcc-bugzilla@gcc.gnu.org
Wed Jun 22 15:28:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71611

--- Comment #2 from Alexander Cherepanov <ch3root at openwall dot com> ---
On 06/22/2016 06:08 PM, jakub at gcc dot gnu.org wrote:
> This has nothing to do with enums based on long, but about anonymous enums.
> <unknown> is what is used for all types that don't have a name.
> Would you prefer <anonymous enum> instead or <anonymous enum at file:line>?

If I change LONG_MIN to INT_MIN in my example then the message talks 
about 'int':

test.c:6:5: runtime error: negation of -2147483648 cannot be represented 
in type 'int'; cast to an unsigned type to negate this value to itself

So it definitely depends on an integer type that the enum is based on. 
But maybe this was not intentional?


More information about the Gcc-bugs mailing list