Bug 15965 - gcc-java does not understand constant in switch
Summary: gcc-java does not understand constant in switch
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-11 00:01 UTC by mal
Modified: 2008-05-01 15:37 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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]$


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