Bug 175569 - can't see private static final int CREATE = 1
Summary: can't see private static final int CREATE = 1
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc4
Version: 4.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 173278
TreeView+ depends on / blocked
 
Reported: 2005-12-12 21:53 UTC by Andrew Cagney
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-07-26 20:52:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Shan't. (1.06 KB, text/plain)
2005-12-13 10:49 UTC, Andrew Haley
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Sourceware 2041 0 None None None Never

Description Andrew Cagney 2005-12-12 21:53:22 UTC
(this is preliminary information, real test case to follow :-)

Rick's finding with gcj4 (GCC) 4.0.2 20051130 (Red Hat 4.0.2-12.EL4) while
building jdom:

 cd ../../jdom-1.0
+ /usr/bin/gcj4 -C -Ipackage -Isrc/java -O -g -d
/home/rmoseley/frysk-devel/frysk/RHEL-4/frysk-0.0.0.20051211.1/build/jdom-1.0
@jdom.files
./src/java/org/jdom/ContentList.java: In class
'org.jdom.ContentList$FilterListIterator':
./src/java/org/jdom/ContentList.java: In method
'org.jdom.ContentList$FilterListIterator.hasNext()':
./src/java/org/jdom/ContentList.java:755: error: Constant expression required.
	case CREATE: cursor = initialCursor;
	
CREATE is declared private static final int CREATE = 1

I've also seen the same problem (same code) on FC-5's 4.1 compiler.
This was compiling with the U2 compiler.

There is a possible workaround - edit the code so that the methods are not private.

Comment 1 Andrew Cagney 2005-12-13 03:27:42 UTC
class C
{
    private static final int CONST  = 0;
    class I {
        public void f () {
            switch(0) {
            case CONST:
            }
        }
    }
}


Comment 2 Andrew Cagney 2005-12-13 03:28:35 UTC
[cagney@eclipse_1 jdom-1.0]$ gcj4 -C -I src/java src/java/org/jdom/ContentList.java
src/java/org/jdom/ContentList.java: In class 'C$I':
src/java/org/jdom/ContentList.java: In method 'C$I.f()':
src/java/org/jdom/ContentList.java:7: error: Constant expression required.
               case CONST:
               ^
src/java/org/jdom/ContentList.java: In class 'C':
src/java/org/jdom/ContentList.java: In method '<clinit>()':
src/java/org/jdom/ContentList.java:3: error: final field âCONSTâ may not have
been initialized
src/java/org/jdom/ContentList.java:1: confused by earlier errors, bailing out


Comment 3 Andrew Haley 2005-12-13 10:49:23 UTC
Created attachment 122172 [details]
Shan't.

Comment 5 Rick Moseley 2005-12-13 18:38:32 UTC
After a small change to one file I was able to completely build the frysk
package using the 4.0.2-12 compiler.


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