Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

kovdan01
Copy link
Contributor

@kovdan01 kovdan01 commented Feb 8, 2024

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) |
      |               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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) |
      |               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
@kovdan01 kovdan01 added the pauth label Feb 8, 2024
@kovdan01 kovdan01 requested review from asl and atrosinenko February 8, 2024 23:00
@asl
Copy link
Contributor

asl commented Feb 26, 2024

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

@kovdan01 kovdan01 merged commit 4037468 into elf-pauth Feb 26, 2024
kovdan01 added a commit that referenced this pull request Mar 7, 2024
Includes changes from the following commits from the branch
https://github.com/ahmedbougacha/llvm-project/tree/eng/arm64e-upstream-llvmorg

- Initial support  ahmedbougacha/llvm-project@cc7ba7e
- ObjC isa signing ahmedbougacha/llvm-project@c9ce0d4

Also applies a fix from #75

Co-authored-by: Ahmed Bougacha <[email protected]>
kovdan01 added a commit to kovdan01/llvm-project that referenced this pull request Mar 7, 2024
Includes changes from the following commits from the branch
https://github.com/ahmedbougacha/llvm-project/tree/eng/arm64e-upstream-llvmorg

- Initial support  ahmedbougacha@cc7ba7e
- ObjC isa signing ahmedbougacha@c9ce0d4

Also applies a fix from access-softek/llvm-project#75

Co-authored-by: Ahmed Bougacha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants