This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcj/164: compiler permits "volatile final" variables



>Number:         164
>Category:       gcj
>Synopsis:       compiler permits "volatile final" variables
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 06 16:40:01 PST 2000
>Closed-Date:
>Last-Modified:
>Originator:     Bryce McKinlay
>Release:        gcc version 2.96 20000305 (experimental)
>Organization:
>Environment:
any
>Description:
The keywords "volatile" and "final" are contradictory. The
JLS 2nd ed (8.3.1) says "A compile-time error occurs if a 
final variable is also declared volatile."

gcj does not throw an error.
>How-To-Repeat:
Compile this test:

class Volatile
{
  volatile final int foo = 8;
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]