Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!purdue!haven!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: Type of expression in switch statement Message-ID: <20448@mimsy.umd.edu> Date: 30 Oct 89 07:40:56 GMT References: <1989Oct30.043155.1931@eng.umd.edu> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 23 In article <1989Oct30.043155.1931@eng.umd.edu> nero@eng.umd.edu (Oren L. Stern) writes: >... where I meant to type "switch (node->tag)", I accidentally typed >"switch (node)". cc ... lint took it without complaint ... on a >Sparcstation 1 running SunOS 4.0.3. ... Is there something wrong with >Sun's compiler, or is there (gasp!) a mistake in K&R? For all things T, for all questions of the form: T and SunOS conflict. Is T wrong, or is SunOS wrong? the probability of the answer being `SunOS is wrong' is about 95%. :-) This was fixed some time ago in 4BSD: "foo.c", line n: warning: switch expression not type int Incidentally, switch expressions of type `long' are now legal as well, so this error message should be changed to `... not integral type'. -- `They were supposed to be green.' In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris