This is an archive of the discontinued LLVM Phabricator instance.

Add a FixItHint for -Wmissing-prototypes to insert 'static '.
AbandonedPublic

Authored by alexfh on Apr 18 2017, 9:17 AM.

Details

Reviewers
djasper
rsmith
Summary

Missing 'static' on functions that are intended to be local to a translation
unit seems to be the most common cause of -Wmissing-prototypes warnings, so
suggesting a fix seems to be convenient and useful.

Event Timeline

alexfh created this revision.Apr 18 2017, 9:17 AM
djasper added inline comments.Apr 18 2017, 2:49 PM
lib/Sema/SemaDecl.cpp
11652

Fix the format while here?

11653

Maybe s/Possible/Possibly/ ?

11708

Does this exclude templated functions? If not, the "static" might be put into the wrong place.

12114

I wonder whether it is useful to display the changed message here. In the cases I have seen where the function definition is coming from a macro, you'd actually need to surround it with an unnamed namespace to fix. Maybe just add this logic to the outer if statement?

alexfh abandoned this revision.Dec 3 2022, 2:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 3 2022, 2:39 PM