Bug 175569

Summary: can't see private static final int CREATE = 1
Product: Red Hat Enterprise Linux 4 Reporter: Andrew Cagney <cagney>
Component: gcc4Assignee: Jakub Jelinek <jakub>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 4.0CC: rmoseley
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-26 20:52:30 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:
Bug Depends On:    
Bug Blocks: 173278    
Attachments:
Description Flags
Shan't. none

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.