[PATCH] D123456: [C89/C2x] Diagnose calls to a function without a prototype but passes arguments

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 12 06:18:46 PDT 2022


erichkeane added inline comments.


================
Comment at: clang/docs/ReleaseNotes.rst:126
+  a prototype will change behavior in C2x. Additionally, it will diagnose calls
+  to a function without a prototype but arguments are provided, only so long as
+  the ``-Wdeprecated-non-prototype`` option is enabled at the function
----------------
This reads awkwardly to me...   Maybe something like?

Additionally, it will diagnose calls with provided arguments to a function without a prototype.  This warning is enabled only when the ``-Wdeprecated-non-prototype`` option is enabled at the function declaration, which allows a developer to disable the diagnostic for all callers at the point of declaration.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:5558
+def warn_strict_uses_without_prototype : Warning<
+  "calling %select{a function|%1}0 with arguments when the function has no "
+  "prototype">, InGroup<DeprecatedNonPrototype>;
----------------
perhaps:

"function %select{|%1}0 without prototype called with arguments specified"

or something like that?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123456/new/

https://reviews.llvm.org/D123456



More information about the cfe-commits mailing list