Path: 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 /* Version: * gcc version 1.33 * File: * * Compile with: * gcc -c * Problem: * Incorrect error message. * Output: * : In function bar: * :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