serge@ucbvax.UUCP (03/26/87)
% cat t.c
typedef enum One { ONE=1, TWO=2 } One;
typedef enum Two { THREE=1, FOUR=2 } Two;
#ifdef c_plusplus
extern void f(One o);
#endif
void
f(o)
One o;
{
o = o;
}
main()
{
f(FOUR);
}
% CC t.c
CC t.c:
"t.c", line 9: warning: old style definition of f()
cc t..c -lC
% lint t.c
f, arg. 1 used inconsistently t.c(11) :: t.c(17)
% exit
Serge
serge@ucbvax.berkeley.edu
...!ucbvax!sergebs@alice.UUCP (03/29/87)
``that is not a bug; it is a feature''
C++ like C does not recognize ennumerations as separate types (whatever
4.? lint says). enumerators are constants of type int.
Note that even the following is legal (if not sensible):
enum E { blue, green } e = 7;
Comments to /dev/nul or ANSI - please.