Page MenuHomePhabricator

Bug 20796 - GCC's -Wstrict-prototypes warning not implemented in Clang
ClosedPublic

Authored by arphaman on Jan 25 2016, 7:18 AM.

Details

Summary

https://llvm.org/bugs/show_bug.cgi?id=20796
Implementation for C only warning -Wstrict-prototypes. Function declarations which have no parameters specified are diagnosed and also K&R function definitions with more than 0 parameters which are not preceded by previous prototype declaration.

Diff Detail

Repository
rL LLVM

Event Timeline

ptitei updated this revision to Diff 45864.Jan 25 2016, 7:18 AM
ptitei retitled this revision from to Bug 20796 - GCC's -Wstrict-prototypes warning not implemented in Clang.
ptitei updated this object.
ptitei added a reviewer: cfe-commits.
ptitei updated this object.
cfe-commits edited edge metadata.Jan 25 2016, 8:35 AM
cfe-commits added a subscriber: cfe-commits.

Thanks for working on this!

ptitei added a subscriber: ptitei.Jan 25 2016, 9:19 AM

Thanks for the fast review.

(This is http://llvm.org/PR20796, which has some discussion and test cases. If you haven't, maybe you want to look at the test cases there. It's possible they're a subset of your test though.)

bruno added a subscriber: bruno.Sep 13 2016, 1:50 PM

Hi Paul,

I'm interested in this patch. Do you have any plans to wrap it up?

Hi Paul,

Are you planning to work on this patch? If not, can I take a shot at it?

Cheers,
Alex

arphaman commandeered this revision.Nov 9 2016, 7:42 AM
arphaman updated this revision to Diff 77351.
arphaman added a reviewer: ptitei.
arphaman added reviewers: rsmith, bruno.
arphaman set the repository for this revision to rL LLVM.

I rebased the patch, adjusted the test and added a test case for Objective-C blocks.

bruno edited edge metadata.Dec 2 2016, 10:02 AM

Hi Alex, thanks for following up with this!

lib/Sema/SemaDecl.cpp
11819 ↗(On Diff #77351)

There's an extra 'declaration' here

lib/Sema/SemaType.cpp
4189 ↗(On Diff #77351)

No need for the curly braces here!

arphaman updated this revision to Diff 80285.Dec 5 2016, 10:03 AM
arphaman edited edge metadata.
arphaman marked 2 inline comments as done.

The updated patch addresses Bruno's comments.

bruno accepted this revision.Dec 6 2016, 9:55 AM
bruno edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 6 2016, 9:55 AM
This revision was automatically updated to reflect the committed changes.