This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug ada/23973] New: without -gnat05, GNAT warns that interface is new kw, but misses one frequent occurence
- From: "bauhaus at futureapps dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Sep 2005 20:40:26 -0000
- Subject: [Bug ada/23973] New: without -gnat05, GNAT warns that interface is new kw, but misses one frequent occurence
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider
package Ip is
type T is interface;
end Ip;
GNATMAKE 4.1.0 20050915 (experimental)
Copyright 1995-2004 Free Software Foundation, Inc.
"ip.ali" being checked ...
-> "ip.ali" missing.
gcc -c -gnatwa -gnatf -gnatv ip.ads
GNAT 4.1.0 20050915 (experimental)
Copyright 1992-2005 Free Software Foundation, Inc.
Compiling: ip.ads (source file time stamp: 2005-09-19 20:18:33)
3. type T is interface;
|
>>> missing "new"
5 lines: 1 error
End of compilation
In this case the compiler doesn't detect that interface is a
reserved word in Ada 2005 (nothing wrong here, as -gnat05 hadn't
been given). It does detect this though, when for example T is
declared to be a limited interface:
type T is limited interface;
3. type T is limited interface;
|
>>> abstract interface is an Ada 2005 extension
>>> unit must be compiled with -gnat05 switch
Likewise, for the semi-garbage input
package LIp is interface
1. package LIp is interface
|
>>> warning: "interface" is a reserved word in Ada 2005
>>> declaration expected
It would be nice if GNAT could issue a similar warning when
"interface" appears after plain "type T is".
--
Summary: without -gnat05, GNAT warns that interface is new kw,
but misses one frequent occurence
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bauhaus at futureapps dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23973