Possible bug in the SUN C compiler

Guy Harris guy at gorodish.Sun.COM
Tue Jun 14 09:57:29 AEST 1988


> The problem is that the compiler allows one to use variables of struct type
> as switch selectors.  This can't be right.  Can it???

No, it can't.

> Below is a code fragment which compiles without error on SUN OS version 3.5.

"Fixed in 4.0".  Some versions of PCC didn't catch this; 4.3BSD's and SunOS
4.0's versions have been fixed to do so (although 4.3BSD's just issues a
warning, for some unknown reason; ours considers this an error).



More information about the Comp.lang.c mailing list