[PATCH] D79945: [Sema] Comparison of pointers to complete and incomplete types

Benson Chu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 07:06:06 PDT 2020


pestctrl marked an inline comment as done.
pestctrl added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:11571
+          Diag(Loc,
+               getLangOpts().C11
+                   ? diag::ext_typecheck_compare_complete_incomplete_pointers
----------------
efriedma wrote:
> I think this condition is backwards?  Should be `!getLangOpts().C11`.  You want the warning with `-std=c99 -pedantic`, you don't want the warning with `std=c11 -pedantic`.
I don't think it's backwards. If getLangOpts().C11, then it is an extension. Otherwise, it is the warning. I can switch the conditions if it is confusing though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79945





More information about the cfe-commits mailing list