What value does an enumeration object have if it is set to a value not equal to any of its respective enumeration constants?
Consider the following code:
<
enum foobar{
FOO = 1,
BAR = 5
};
enum foobar baz = 5;
the baz declaration is equivalent to:
enum foobar baz = BAR;
as BAR is an int of value 5.
This declaration is also valid:
enum foobar qux = 42;
C says an enum type is an integer type sufficiently large to represent all its enum constants. If the enum type is not sufficiently large, the value is converted to the enum integer type as for every integer type as per the rules of integer conversion (c99, 6.3.1.3). This integer conversion can be implementation-defined (see 6.3.1.3p3).