public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/37620] New: warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls
@ 2008-09-23 10:26 esigra at gmail dot com
2008-09-23 10:28 ` [Bug ada/37620] " esigra at gmail dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: esigra at gmail dot com @ 2008-09-23 10:26 UTC (permalink / raw)
To: gcc-bugs
Even though a variable is referenced by (implicit) procedure calls (such as
Initialize and Finalize), GCC gives:
warning: variable "X" is not referenced
This happens especially when using the RAII design pattern. The warning should
not be shown when the variable is referenced by a procedure call, even if it is
implicit. Sample code attached.
--
Summary: warning: variable "X" is not referenced eventhough it is
referenced by (implicit) procedure calls
Product: gcc
Version: 4.2.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: ada
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: esigra at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37620
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug ada/37620] warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls
2008-09-23 10:26 [Bug ada/37620] New: warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls esigra at gmail dot com
@ 2008-09-23 10:28 ` esigra at gmail dot com
2008-09-23 10:29 ` esigra at gmail dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: esigra at gmail dot com @ 2008-09-23 10:28 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from esigra at gmail dot com 2008-09-23 10:26 -------
Created an attachment (id=16390)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16390&action=view)
Makefile
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37620
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug ada/37620] warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls
2008-09-23 10:26 [Bug ada/37620] New: warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls esigra at gmail dot com
2008-09-23 10:28 ` [Bug ada/37620] " esigra at gmail dot com
@ 2008-09-23 10:29 ` esigra at gmail dot com
2008-09-23 10:33 ` esigra at gmail dot com
2008-09-23 11:33 ` sam at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: esigra at gmail dot com @ 2008-09-23 10:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from esigra at gmail dot com 2008-09-23 10:27 -------
Created an attachment (id=16391)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16391&action=view)
implementation
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37620
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug ada/37620] warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls
2008-09-23 10:26 [Bug ada/37620] New: warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls esigra at gmail dot com
2008-09-23 10:28 ` [Bug ada/37620] " esigra at gmail dot com
2008-09-23 10:29 ` esigra at gmail dot com
@ 2008-09-23 10:33 ` esigra at gmail dot com
2008-09-23 11:33 ` sam at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: esigra at gmail dot com @ 2008-09-23 10:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from esigra at gmail dot com 2008-09-23 10:32 -------
Created an attachment (id=16392)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16392&action=view)
Makefile
--
esigra at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #16390|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37620
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug ada/37620] warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls
2008-09-23 10:26 [Bug ada/37620] New: warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls esigra at gmail dot com
` (2 preceding siblings ...)
2008-09-23 10:33 ` esigra at gmail dot com
@ 2008-09-23 11:33 ` sam at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: sam at gcc dot gnu dot org @ 2008-09-23 11:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from sam at gcc dot gnu dot org 2008-09-23 11:32 -------
I don't agree with your reasoning: X is not referenced. The fact that it has a
constructor should not change anything. For example, access types are
initialized to Null as well, so you could count that as a reference.
You can suppress the warning by using
pragma Unreferenced (X);
--
sam at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sam at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37620
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-09-23 11:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-23 10:26 [Bug ada/37620] New: warning: variable "X" is not referenced eventhough it is referenced by (implicit) procedure calls esigra at gmail dot com
2008-09-23 10:28 ` [Bug ada/37620] " esigra at gmail dot com
2008-09-23 10:29 ` esigra at gmail dot com
2008-09-23 10:33 ` esigra at gmail dot com
2008-09-23 11:33 ` sam at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).