[PATCH] D122895: [C89/C2x] Improve diagnostics around strict prototypes in C

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 13 07:35:41 PDT 2022


aaron.ballman added a comment.

In D122895#3511611 <https://reviews.llvm.org/D122895#3511611>, @dexonsmith wrote:

> Sure, I'm all for adding a new warning for users that want a pedantic warning. Can it be put behind a separate flag, such as `-Wstrict-prototypes-pedantic`, which isn't triggered by `-Wstrict-prototypes`?
>
> Previously, `-Wstrict-prototypes` was useful for preventing actual bugs in code.

Doing that would then make `-Wstrict-prototypes` effectively a no-op (it would still control `-Wdeprecated-non-prototype` I suppose?), but there were also people who enabled `-Wstrict-prototypes` because they wanted the pedantic aspects of the warning in cases where it was firing, and those folks would then be losing warning coverage without knowing it. For example:

  void f(){}

In prior versions of Clang with `-Wstrict-prototypes` this would issue a `this old-style function definition is not preceded by a prototype` diagnostic, but would now be silenced entirely unless the user knew to turn on a different flag.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122895



More information about the cfe-commits mailing list