🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2180

gcc 1.32 duplicate case bug

#2180
From: Geoff Rimmer
Date: Wed, 25 Jan 1989 21:55
48 lines
1654 bytes
main()
{
	int z;
	char *str;
	
	z=atoi(gets(str=(char*)malloc(10)));
	switch(z)
	{
	case 1:
		printf("ONE\n");
		break;
	case 2:
		printf("TWO\n");
		break;
	case 1:
		printf("ONE AGAIN\n");
		break;
	}
}

cc (Sun OS4.0) gives 

	"case.c", line 18: duplicate case in switch, 1

lint (Sun OS4.0) gives

	case.c(18): duplicate case in switch, 1

but ... gcc version 1.32 DOESN'T COMPLAIN!!!

Is there a later version of gcc that has this bug fixed?

Geoff

	------------------------------------------------------------
	Geoff Rimmer, Computer Science, Warwick University, England.
			geoff@uk.ac.warwick.cs
			estnkcj@uk.ac.warwick.cu
	
	"I didn't ask to be made.  No consulted me or considered my
	 feelings in the matter, not that anyone considered that I
	 might *have* feelings.  After I was made, I was left in a
	 dark room for six months, and me with this terrible pain in
	 all the diodes down my left side.  My one and only true
	 friend was a small rat.  One day it climbed into a cavity of
	 my inner leg and died.  I've a horrible feeling it's still
	 there." - Marvin, The Hitch Hiker's Guide to the Galaxy.
	------------------------------------------------------------
Technical Details
Message-ID: <958@ubu.warwick.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!axion!ukc!warwick!geoff
References: <8901201214.AA03028@moose.cita.utoronto.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!uunet!axion!ukc!warwick!geoff
From: geoff@warwick.UUCP (Geoff Rimmer)
Newsgroups: gnu.gcc.bug
Subject: gcc 1.32 duplicate case bug
Message-ID: <958@ubu.warwick.UUCP>
Date: 25 Jan 89 21:55:01 GMT
References: <8901201214.AA03028@moose.cita.utoronto.ca>
Sender: news@warwick.UUCP
Reply-To: geoff@emerald.UUCP (Geoff Rimmer)
Organization: Computer Science, Warwick University, UK
Lines: 48