[Bug c/78736] New: enum warnings in GCC
erika.molnar at cyberthorstudios dot com
gcc-bugzilla@gcc.gnu.org
Thu Dec 8 12:28:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78736
Bug ID: 78736
Summary: enum warnings in GCC
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: erika.molnar at cyberthorstudios dot com
Target Milestone: ---
Hi,
This is not a bug but when compiling with gcc-6.2 the following code:
*******
#include <stdio.h>
typedef enum {brandon, jon, mitch} name_t;
typedef enum {fred, dog, cat} name2_t;
name2_t name = brandon;
name_t hik = 3;
int hal_entry(void)
{
if (hik < name)
return(0);
return 1;
}
int main ()
{
printf ("%d\n", hal_entry());
return 0;
}
*******
There is no warning about the enum(which is correct in C) however when I
compile the same code with a different/proprietary compiler I get the following
warning:
W0511180:The evaluation period has expired.
../src/cc.c(33):W0520188:Enumerated type mixed with another type
../src/cc.c(34):W0520188:Enumerated type mixed with another type
Would you consider implementing such a warning in GCC?
__
Thank you,
Erika Molnar
More information about the Gcc-bugs
mailing list