[PATCH] D103885: [clang] Suppress warnings for tautological comparison in generated macro code

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 8 05:38:57 PDT 2021


aaron.ballman added a comment.

In D103885#2805217 <https://reviews.llvm.org/D103885#2805217>, @protze.joachim wrote:

> I don't think, this needs ifdefs. As I understand, a compiler is supposed to ignore unknown pragmas.

It does. You can see it produces diagnostics in `-Wall` mode in GCC and it produces diagnostics at any warning level in MSVC or ICC (https://godbolt.org/z/58nqGx14o). We don't use it often in the code base, but the very select places we've done it, we've protected it (https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/Hexagon/HexagonDepDecoders.inc#L12, https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/ADT/StringRef.h#L878 which are the only two non-test places in the Clang + LLVM + extra code base we've done this before).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103885



More information about the llvm-commits mailing list