[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 Apr 29 07:45:34 PDT 2022
aaron.ballman added a comment.
In D122895#3482555 <https://reviews.llvm.org/D122895#3482555>, @tahonermann wrote:
>> I think it's debatable whether this is a bug or not
> For C99 through C17, I kind of agree, but for C2x (where the warning is still issued with `-Wstrict-prototypes`), my understanding is that `void foo(void)` and `void foo()` are equivalent; there is no unprototyped declaration. I think the diagnostic should at least be suppressed for C2x since we don't want to encourage programmers to explicitly add `void` when targeting that standard.
Good catch... `-Wstrict-prototypes` should be a noop in C2x mode! I'll work on fixing that.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits