[Bug java/21540] switch stmt problem
hchapman-gcc-bugs at 3gfp dot com
gcc-bugzilla@gcc.gnu.org
Thu May 19 15:09:00 GMT 2005
------- 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
More information about the Java-prs
mailing list