public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/59849] New: GCC doesn't warn unused global const variable
@ 2014-01-16 23:10 hjl.tools at gmail dot com
  2014-01-16 23:52 ` [Bug middle-end/59849] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: hjl.tools at gmail dot com @ 2014-01-16 23:10 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59849

            Bug ID: 59849
           Summary: GCC doesn't warn unused global const variable
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com

[hjl@gnu-mic-2 gcc]$ cat /tmp/w.c
static const int foo;
static int bar;
[hjl@gnu-mic-2 gcc]$ ./xgcc -B./ -Wall -c /tmp/w.c
/tmp/w.c:2:12: warning: ‘bar’ defined but not used [-Wunused-variable]
 static int bar;
            ^
[hjl@gnu-mic-2 gcc]$ 

GCC should also warn unused foo.
>From gcc-bugs-return-440644-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Jan 16 23:49:52 2014
Return-Path: <gcc-bugs-return-440644-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24804 invoked by alias); 16 Jan 2014 23:49:52 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 24730 invoked by uid 48); 16 Jan 2014 23:49:48 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/59849] GCC doesn't warn unused global const variable
Date: Thu, 16 Jan 2014 23:49:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-59849-4-DDtiNo56RW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59849-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59849-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg01786.txt.bz2
Content-length: 499

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY849

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This was done on purpose as static constants are normally in the header files.


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

* [Bug middle-end/59849] GCC doesn't warn unused global const variable
  2014-01-16 23:10 [Bug middle-end/59849] New: GCC doesn't warn unused global const variable hjl.tools at gmail dot com
@ 2014-01-16 23:52 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-01-16 23:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59849

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |DUPLICATE

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 28901.

*** This bug has been marked as a duplicate of bug 28901 ***


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

end of thread, other threads:[~2014-01-16 23:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-16 23:10 [Bug middle-end/59849] New: GCC doesn't warn unused global const variable hjl.tools at gmail dot com
2014-01-16 23:52 ` [Bug middle-end/59849] " pinskia at gcc dot gnu.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).