This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/21540] switch stmt problem
- From: "hchapman-gcc-bugs at 3gfp dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 May 2005 15:09:21 -0000
- Subject: [Bug java/21540] switch stmt problem
- References: <20050512200245.21540.green@redhat.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From hchapman-gcc-bugs at 3gfp dot com 2005-05-19 15:09 -------
gcc has this problem as well. Although, it will let you have an expression using
only constants like
case 'A' + ('B'<<8):
but not
case *((uint16_t *)"AB"):
A gcc example:
#include <stdio.h>
int main()
{
unsigned int xxx = 0x3456;
switch(0x34)
{
case ((int)(xxx >> 16)):
printf("Shift\n");
break;
default:
printf("No shift\n");
break;
}
return(0);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21540