Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!usc!orion.oac.uci.edu!uci-ics!gateway From: schmidt@glacier.ics.uci.edu (Doug Schmidt) Newsgroups: gnu.g++ Subject: Re: Enumeration Problem (Simple) Keywords: Switch, Enumeration Message-ID: <25A4350F.11937@paris.ics.uci.edu> Date: 5 Jan 90 05:47:59 GMT References: <7570@hubcap.clemson.edu> Reply-To: schmidt@glacier.ics.uci.edu (Doug Schmidt) Distribution: na Organization: University of California, Irvine - Dept of ICS Lines: 15 In-reply-to: rajarar@hubcap.clemson.edu (Bala Rajaraman) In article <7570@hubcap.clemson.edu>, rajarar@hubcap (Bala Rajaraman) writes: > >Stroustrup's C++ book indicates that if in a switch only a few of the >enumerated values are handled the compiler issues a warning [pg. 64-65]. > In the following program the g++ compiler neither issues a warning, >nor does it prevent me from assigning an arbitrary value to a variable of >an enumerated type. Try using the -Wall -Wenum-clash flag with g++. This will warn about the unused enum value in the switch and the assignment of an integer to an enumeral. Doug -- Douglas C. Schmidt