[Bug c/51676] New: -Wsuggest-attribute={pure,const} should give line number of declaration, not definition
b.r.longbons at gmail dot com
gcc-bugzilla@gcc.gnu.org
Sun Dec 25 06:06:00 GMT 2011
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
More information about the Gcc-bugs
mailing list