[PATCH] D28148: [Sema] Suppress warnings for C's zero initializer

S. Gilles via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 29 19:07:46 PST 2016


sgilles added a comment.

Thank you for the comments, rsmith.  I'm addressing them now, and I'll make sure to add your examples to the test case.  I don't think `isSyntactic()` exists, so I'm using `!getSyntactic()` instead, which should have the desired effect.

In https://reviews.llvm.org/D28148#632484, @fhahn wrote:

> Ops, it looks like I accidentally switched the diff back to the initial version and I have no idea how to switch it back :(
>
> I am very sorry about that, would you mind uploading the latest version again?


No problem - I'll upload a new version to address rsmith's comments in a bit.

In https://reviews.llvm.org/D28148#632541, @Quuxplusone wrote:

> (IOW, it looks as if this patch proposes to fix the noisy diagnostic for every language //except for// C-sometimes-compiled-as-C++, and as a sometime writer of C-sometimes-compiled-as-C++ myself, that irks me. Apologies if I've misconstrued the patch.)


My intention was only to fix the noisy diagnostic only for C compiled as C, because that's my particular use case and I didn't want to accidentally remove valuable warnings for other use cases.  Extending this to the case of C-sometimes-compiled-as-C++ should be as easy as dropping the `getLangOpts().CPlusPlus`.  But is this warning useful for C++-compiled-as-C++?  Perhaps it would be better to wait until explicit recognition of C-as-C++ to do that.


https://reviews.llvm.org/D28148





More information about the cfe-commits mailing list