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: unassig...@gcc.gnu.org ReportedBy: b.r.longb...@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