🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #2270

Small bug in gcc

#2270
From: Derek Clegg
Date: Thu, 09 Feb 1989 00:07
36 lines
1174 bytes
/* Version:
 *     gcc version 1.33
 * File:
 *     <this file>
 * Compile with:
 *     gcc -c <this file>
 * Problem:
 *	Incorrect error message.
 * Output:
 *	<this file>: In function bar:
 *	<this file>:28: case label does not reduce to an integer constant
 * Comments:
 *	It seems that `gcc' does not consider a case label containing an
 *	explicit int cast to be an integer constant.
 * Notes:
 *     gcc was compiled with `config.gcc sun3'
 *     I am using a Sun 3/60 with UNIX 4.2 (Sun release 3.5).
 */

enum FOO { A = 1, B = 2 };

int
bar(int type)
{
    switch (type) {
    case (A):
	return (0);
    case ((int)B):
	return (1);
    }
    return (-1);
}

#if 0
	Derek B Clegg ({uunet,ucbcad,sun}!island!fiji!derek)
#endif
Technical Details
Message-ID: <8902090007.AA13651@fiji.island.uucp>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!island!fiji!derek

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!dptcdc!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!UUNET.UU.NET!island!fiji!derek
From: island!fiji!derek@UUNET.UU.NET (Derek Clegg)
Newsgroups: gnu.gcc.bug
Subject: Small bug in gcc
Message-ID: <8902090007.AA13651@fiji.island.uucp>
Date: 9 Feb 89 00:07:29 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 36