[PATCH] D66919: Warn about zero-parameter K&R definitions in -Wstrict-prototypes

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 2 16:05:17 PDT 2019


dexonsmith added a comment.

I went back to read notes from when we deployed `-Wstrict-prototypes` (which we have had on-by-default for our users for a couple of years, since it catches lots of `-fblocks`-related bugs).  I was mainly objecting because I had (mis)remembered trying and backing out the specific behaviour you're adding.  On the contrary, our notes say that we might want to strengthen the diagnostic as you're doing.

I'm still nervous about this, but I'm withdrawing my objection.

In D66919#1653188 <https://reviews.llvm.org/D66919#1653188>, @aaronpuchert wrote:

> Do we have any precedence for a warning that's treated as error by default? I haven't seen that before, that's why I'm asking. Even `-Wreturn-type` isn't treated as error by default.


There are tons of `-Werror`-by-default in Objective-C, at least.  I'm not sure if it's used elsewhere, but for almost-guaranteed bugs it seems like the right thing to do.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66919





More information about the cfe-commits mailing list