From: Jan Andres <J@nAndr.es>
Subject: Strange GNAT compiler warning
Date: Wed, 28 Dec 2011 14:37:57 +0000 (UTC)
Date: 2011-12-28T14:37:57+00:00 [thread overview]
Message-ID: <jdf9k5$t9s$1@dont-email.me> (raw)
Consider the following package:
package Strange_Warning is
type Foo is limited interface;
type Bar is new Foo with null record;
end Strange_Warning;
When I compile this package with GNAT GPL 2011 and use the "-Wall"
option, I get the following warnings:
strange_warning.ads: In function 'Strange_Warning':
strange_warning.ads:3:14: warning: 'F' is used uninitialized in this function
strange_warning.ads: In function 'Strange_Warning':
strange_warning.ads:3:14: warning: 'C' is used uninitialized in this function
strange_warning.ads:3:14: warning: 'F' is used uninitialized in this function
strange_warning.ads: In function 'Strange_Warning':
strange_warning.ads:3:14: warning: 'C' is used uninitialized in this function
strange_warning.ads:3:14: warning: 'F' is used uninitialized in this function
The same thing shows up with the GNAT compiler that comes bundled with
recent versions of gcc, e.g. in 4.6.2. It's seemingly related to the
"limited" keyword in the definition of the interface. If that keyword
is removed, the warnings go away.
These warnings look bogus to me; clearly there is nothing named C or F
in the above code, so this must be something internal to the compiler.
Is it a bug in the compiler or run-time? Has anyone seen this before and
knows a solution or workaround?
Thanks,
Jan
next reply other threads:[~2011-12-28 14:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-28 14:37 Jan Andres [this message]
2011-12-28 16:49 ` Strange GNAT compiler warning Georg Bauhaus
2011-12-28 17:47 ` Jan Andres
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox