Bug 15965 - gcc-java does not understand constant in switch
gcc-java does not understand constant in switch
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-10 20:01 EDT by mal
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-13 18:35:27 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description mal 2000-08-10 20:01:05 EDT
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 18:35:25 EDT
Should be fixed in 
http://gcc.gnu.org/ml/gcc-patches/2000-08/msg00516.html
Comment 2 Jakub Jelinek 2000-08-21 03:26:34 EDT
Fixed in gcc-java 2.96-53
Comment 3 mal 2000-08-21 09:28:06 EDT
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]$

Note You need to log in before you can comment on or make changes to this bug.