That should be quite trivial, e.g.,
Code:
#include <stdio.h>
enum Foo {Bar, Baz};
int main(void)
{
enum Foo x = 123;
printf("Valid values of enum Foo: %d, %d\nx = %d\n", Bar, Baz, x);
return 0;
}
If you compile the above program at the highest warning levels possible for your compiler, you might find that your compiler gives no warning whatsoever. Yet, when you run the program, you would get:
Code:
Valid values of enum Foo: 0, 1
x = 123
Clearly, 123 is not among the valid values of enum Foo, then x, despite being declared as of the enum Foo enumeration type, can store 123 without complaint from the compiler.