public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/51676] New: -Wsuggest-attribute={pure,const} should give line number of declaration, not definition
@ 2011-12-25  6:06 b.r.longbons at gmail dot com
  2011-12-30  6:35 ` [Bug c/51676] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: b.r.longbons at gmail dot com @ 2011-12-25  6:06 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 51676
           Summary: -Wsuggest-attribute={pure,const} should give line
                    number of declaration, not definition
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: b.r.longbons@gmail.com


Created attachment 26184
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26184
minimal testcase for both attributes

Although it's obvious why GCC does what it does, it would be much more useful
if these warnings would give the location at which the attribute would be
added.

Expected result:
Warnings at the (first) declaration. In attached testcase, on lines 2 and 3
(which would usually be in a header file).

Actual result:
Warnings at the definition. In testcase, on lines 4 and 5 (which are usually in
the implementation file).

Tested with: 4.6.0, 4.6.1, 4.6.2, and trunk r182496


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

end of thread, other threads:[~2012-01-02 20:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-25  6:06 [Bug c/51676] New: -Wsuggest-attribute={pure,const} should give line number of declaration, not definition b.r.longbons at gmail dot com
2011-12-30  6:35 ` [Bug c/51676] " pinskia at gcc dot gnu.org
2012-01-02 10:49 ` rguenth at gcc dot gnu.org
2012-01-02 20:27 ` b.r.longbons at gmail dot com

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).