access-softek / llvm-project

Other
0 stars 0 forks source link

[clang] Fix warnings related to enum in `clang::PointerAuthQualifier` #75

Closed kovdan01 closed 7 months ago

kovdan01 commented 8 months ago

Due to location in clang/include/clang/AST/Type.h header, the following warnings cluttered the build log and made identifying other meaningful compiler messages hard.

Warning 1:

/path/to/llvm-project/clang/include/clang/AST/Type.h:182:77: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
  180 |   static_assert((EnabledMask + AddressDiscriminatedMask +
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  181 |                  AuthenticationModeMask + IsaPointerMask +
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  182 |                  AuthenticatesNullValuesMask + KeyMask + DiscriminatorMask) ==
      |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
  183 |                     0xFFFFFFFF,
      |                     ~~~~~~~~~~

Warning 2:

/path/to/llvm-project/clang/include/clang/AST/Type.h:196:38: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
  196 |              (isAddressDiscriminated ? AddressDiscriminatedMask : 0) |
      |               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
asl commented 7 months ago

@ahmedbougacha Likely would make sense to do this in your branch