🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #50331

generating warnings for non-enumatered enums

#50331
From: meissner
Date: Fri, 08 Oct 1993 15:12
26 lines
1236 bytes
| Is there a warning to complain for this
| program?
| 
| there probably should be.
| 
| 	int main()
| 	{
| 		enum { FOO=1, BAR=2 } blah;
| 	 
| 		blah = 5;
| 		return 0;
| 	}
| 
| 
| This is very useful if the compiler can detect when you don't use an 
| enum properly.

Umm, given that the ANSI says that enumeration constants are just
plain integers, the above program is correct and should not suffer
warnings.

--
Michael Meissner	email: meissner@osf.org		phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA, 02142

Old hackers never die, their bugs just increase.
Technical Details
Message-ID: <9310081505.AA01131@pasta.osf.org>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner
References: meissner@osf.ORG

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,fede4154eadbdd6f
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1993-10-08 08:19:53 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!usenet.ins.cwru.edu!magnus.acs.ohio-state.edu!cis.ohio-state.edu!osf.ORG!meissner
From: meissner@osf.ORG
Newsgroups: gnu.gcc.help
Subject: generating warnings for non-enumatered enums
Date: 8 Oct 1993 11:12:04 -0400
Organization: GNUs Not Usenet
Lines: 26
Sender: daemon@cis.ohio-state.edu
Distribution: gnu
Message-ID: <9310081505.AA01131@pasta.osf.org>
References: meissner@osf.ORG