[PATCH] D122983: [C11/C2x] Change the behavior of the implicit function declaration warning

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 1 05:38:00 PDT 2022


aaron.ballman added a comment.

In D122983#3484189 <https://reviews.llvm.org/D122983#3484189>, @rjmccall wrote:

> IIRC, the reason it works it that way is that "warnings which default to an error" are really "errors which you can explicitly downgrade to a warning".  Maybe those ought to be different categories, or maybe we ought to just be telling people to downgrade this specific diagnostic instead of generally using `-Wno-error`.

Thanks for the background John! That seems defensible, but I think we're still in a confused state that we should do something about. A warning which default to an error is not sufficiently warning-like to be disabled via `-w` but isn't sufficiently error-like to be disabled via `-Wno-error`. IMO, one or the other of those options should work with a diagnostic like this.

However, for the time being, the advice is to use `-Wno-error=implicit-function-declaration`, which is what's documented in the release note. The commit message had a shorthand suggesting -Wno-error, but my intent was to suggest people narrowly disable the error instead of broadly disable them all.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D122983



More information about the cfe-commits mailing list