[libcxx-commits] [PATCH] D139114: [Clang][Sema] Enabled implicit conversion warning for CompoundAssignment operator.

Fangrui Song via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 13 16:42:42 PST 2023


MaskRay added a comment.

This will cause warnings for the common usage related to bitmask macros/enumerators.

  #include <elf.h>
  
  int main(void) {
    unsigned char other = 0x81;
    other &= ~STO_AARCH64_VARIANT_PCS;
    return other;
  }

(enumerator) `llvm/tools/llvm-readobj/ELFDumper.cpp:3869:18: warning: implicit conversion from 'int' to 'uint8_t' (aka 'unsigned char') changes value from -129 to 127 [-Wconstant-conversion]`

I think this diagnostic is likely going to be noisy for many projects.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139114



More information about the libcxx-commits mailing list