when I run the below code - I'm getting the warning "narrowing conversion from int to long unsigned int inside {} is ill-formed in C++11 [-Wnarrowing]. I'm using GNU 4.8 compiler.
typedef struct TableEntry
{
unsigned long value;
const char *label;
} TableEntry;
enum FunctionType
{
NORMAL = 0,
RANGE = 1
};
TableEntry functionTypes[] =
{
{NORMAL, "NORMAL"},
{RANGE, "RANGE"}
};
I don't understand why compiler is considering enum as an int?
Is this a bug in GCC 4.8? Is there any workaround?
Any help is appreciated.