[PATCH] D16533: Bug 20796 - GCC's -Wstrict-prototypes warning not implemented in Clang

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 2 10:02:26 PST 2016


bruno added a comment.

Hi Alex, thanks for following up with this!



================
Comment at: lib/Sema/SemaDecl.cpp:11819
+      //   Warn if K&R function is defined without previous declaration
+      //   declaration. This warning is issued only if the difinition itself
+      //   does not provide a prototype. Only K&R definitions do not
----------------
There's an extra 'declaration' here


================
Comment at: lib/Sema/SemaType.cpp:4189
+      if (D.getFunctionDefinitionKind() == FDK_Declaration &&
+          FTI.NumParams == 0 && !LangOpts.CPlusPlus) {
+        S.Diag(DeclType.Loc, diag::warn_strict_prototypes)
----------------
No need for the curly braces here!


Repository:
  rL LLVM

https://reviews.llvm.org/D16533





More information about the cfe-commits mailing list