switch constant issue

Andrew Haley aph@redhat.com
Mon Jun 9 16:41:00 GMT 2003


steve writes:
 > Hey guys,
 > 
 > When is this not a const when using the -fno-assume-compiled?
 > Class Connection
 > {
 > 	static final int C_CLOSE_ACK=1;
 > }
 > 
 > /home/steve/NetFuel/src/AgentRE/src/kernel/com/netfuel/messaging/Session.java:178: 
 > error: Constant expression required.
 > case Connection.C_CLOSE_ACK:
 > 
 > gcc -v
 > Reading specs from /opt/gcc-3.4/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/specs
 > Configured with: ../configure --prefix /opt/gcc-3.4
 > Thread model: posix
 > gcc version 3.3.1 20030602 (prerelease)
 > 
 > If this is a bug I will submit it.
Looks like a bug to me. I guess no-assume-compiled is deferring the
resolution of this constant to runtime, and this conflicts with the
compiler's requirement that case labels be constant. I'm not sure
about the best way to resolve this. Please submit the bug.
Andrew.


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /