Bug 175569 - can't see private static final int CREATE = 1
can't see private static final int CREATE = 1
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gcc4 (Show other bugs)
4.0
All Linux
medium Severity low
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks: 173278
  Show dependency treegraph
 
Reported: 2005-12-12 16:53 EST by Andrew Cagney
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-07-26 16:52:30 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)
Shan't. (1.06 KB, text/plain)
2005-12-13 05:49 EST, Andrew Haley
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 2041 None None None Never

  None (edit)
Description Andrew Cagney 2005-12-12 16:53:22 EST
(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-12 22:27:42 EST
class C
{
    private static final int CONST  = 0;
    class I {
        public void f () {
            switch(0) {
            case CONST:
            }
        }
    }
}
Comment 2 Andrew Cagney 2005-12-12 22:28:35 EST
[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 05:49:23 EST
Created attachment 122172 [details]
Shan't.
Comment 5 Rick Moseley 2005-12-13 13:38:32 EST
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.