comp.lang.ada
 help / color / mirror / Atom feed
* Strange GNAT compiler warning
@ 2011-12-28 14:37 Jan Andres
  2011-12-28 16:49 ` Georg Bauhaus
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Andres @ 2011-12-28 14:37 UTC (permalink / 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-28 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-28 14:37 Strange GNAT compiler warning Jan Andres
2011-12-28 16:49 ` Georg Bauhaus
2011-12-28 17:47   ` Jan Andres

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox