From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4ecd0afd2a2401e1,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.74.201 with SMTP id w9mr22431312pbv.0.1325083078401; Wed, 28 Dec 2011 06:37:58 -0800 (PST) Path: lh20ni73992pbb.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Jan Andres Newsgroups: comp.lang.ada Subject: Strange GNAT compiler warning Date: Wed, 28 Dec 2011 14:37:57 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: Mime-Version: 1.0 Injection-Date: Wed, 28 Dec 2011 14:37:57 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="uVkGfcWZt5c9v3Imi3iqZw"; logging-data="30012"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fNXU8UMP7JTo/5HYeD91qVwo7nzT1I3E=" User-Agent: slrn/0.9.9p1 (Linux) Cancel-Lock: sha1:wSipZjoqEi8bEGBN5UDhjpcPin8= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: 2011-12-28T14:37:57+00:00 List-Id: 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