Bug 49143 - make -Wsuggest-attribute less verbose
Summary: make -Wsuggest-attribute less verbose
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.6.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-24 16:11 UTC by Pierre Habouzit
Modified: 2011-05-25 06:03 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Habouzit 2011-05-24 16:11:16 UTC
In many code bases, -Wsuggest-attribute={const|pure} is really verbose (unlike missing printf/sccanf format attributes or noreturn attributes, which are rarer).

Though it's not particularly useful to mark functions as pure/const when those are known inside the compilation unit or are inline. It'd be great to be able to restrict the -Wsuggest-attribute to functions whose storage isn't static because those are the functions for those it's useful (because it's likely that the prototype lives in some header to be used by external programs).
Comment 1 Manuel López-Ibáñez 2011-05-24 19:16:16 UTC
Pierre, could you add some testcase(s) please? http://gcc.gnu.org/bugs/#need
Comment 2 Pierre Habouzit 2011-05-25 06:03:31 UTC
looks like with the last gcc-4.6 it's already what happens, sorry for the noise!