From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25176 invoked by alias); 16 Jan 2014 21:18:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 25148 invoked by uid 48); 16 Jan 2014 21:18:19 -0000 From: "su at cs dot ucdavis.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/59801] GCC does not warn on unused global variable Date: Thu, 16 Jan 2014 21:18:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 4.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: su at cs dot ucdavis.edu 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: Message-ID: In-Reply-To: References: 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/msg01777.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59801 --- Comment #8 from Zhendong Su --- (In reply to Jakub Jelinek from comment #7) > Those two cases are different, the other PR was about automatic volatile > variables, where if they are unused it is really hard to come up with a way > how they could be modified behind compiler's back. While for this case, > variable in .data/.bss etc. section it is not so hard, the variable has a > name through which it can be referenced, eventhough only from within the > same assembly file. User could inject some assembly which will access it, > the var can use section attribute that places it into some magic section > that is e.g. IO mapped, etc. Thanks Jakub. So, this is confirmed then?