Crossing enumeration types

Paul Schauble Schauble at MIT-MULTICS.ARPA
Sun Jun 8 08:07:06 AEST 1986


Is this program legal according to s strict interpretation of the new
ANSI standard? By common usage? Is this something lint should/does
complain about?

enum days {mon, tue,wed} day;
enum colors {red,green,blue} color;

main ()
{
    day = green;
    set_color (day);
}
set_color(thiscolor)
enum colors thiscolor;
{...
}

I expect at least two complaints about mixing types colors/days. Out
there in the big cruel world, how often am I going to be disappointed?

          Paul
          Schauble at MIT-Multics.arpa



More information about the Comp.lang.c mailing list