Bug 15965

Summary: gcc-java does not understand constant in switch
Product: [Retired] Red Hat Linux Reporter: mal
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-08-13 22:35:27 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mal 2000-08-11 00:01:05 UTC
gcc --version
2.96
(RedHat 7.0 Public Beta)


gcj Y.java  -o x --main=Y
Y.java: In class `Y':
Y.java: In method `main(java.lang.String[])':
Y.java:7: Constant expression required.
   case x:
   ^
1 error


cat Y.java
public class Y {
public static void main(String [] args)
{
 final int x=1;
 int i=2;
 switch(i) {
   case x:
 System.err.println(x);
   default:
        System.err.println("default");
 }
}
}

Comment 1 mal 2000-08-13 22:35:25 UTC
Should be fixed in 
http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00516.html

Comment 2 Jakub Jelinek 2000-08-21 07:26:34 UTC
Fixed in gcc-java 2.96-53

Comment 3 mal 2000-08-21 13:28:06 UTC
2.96-53 is OK

rpm -q gcc-java
gcc-java-2.96-53
[mal@eth0_extrenal tgcc]$ gcj -c Y.java 
[mal@eth0_extrenal tgcc]$