[Bug c/78736] enum warnings in GCC (request for -Wenum-conversion to be added)
jg at jguk dot org
gcc-bugzilla@gcc.gnu.org
Thu Sep 5 20:51:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78736
--- Comment #17 from Jonny Grant <jg at jguk dot org> ---
Hello Joseph
This was the test case I created. There isn't any warning output when 'a_t' is
converted to 'int'. Or even if it was converted to an 'unsigned int'
https://gcc.gnu.org/ml/gcc-help/2019-07/msg00014.html
//-O2 -Wall -Wextra -Wconversion -Werror
#include <cstddef>
typedef enum
{
a = -1
} a_t;
a_t f()
{
return a;
}
int main()
{
int b = f();
return b;
}
More information about the Gcc-bugs
mailing list