[llvm] [AArch64][MachO] Add ptrauth ABI version to arm64e cpusubtype. (PR #104650)

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 12:26:37 PDT 2024


ahmedbougacha wrote:

> When compiled with GCC, this triggers hundreds of warnings like this:
> 
> ```
> In file included from /home/martin/code/llvm-project/llvm/include/llvm/Object/MachO.h:23,
>                  from /home/martin/code/llvm-project/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:43:
> /home/martin/code/llvm-project/llvm/include/llvm/BinaryFormat/MachO.h: In function ‘unsigned int llvm::MachO::CPU_SUBTYPE_ARM64E_WITH_PTRAUTH_VERSION(unsigned int, bool)’:
> /home/martin/code/llvm-project/llvm/include/llvm/BinaryFormat/MachO.h:1664:35: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
>  1664 |          (PtrAuthKernelABIVersion ? CPU_SUBTYPE_ARM64E_KERNEL_PTRAUTH_ABI_MASK
>       |           ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>  1665 |                                   : 0) |
>       |                                   ~~~
> ```

Hmm, playing around with various gcc versions in godbolt this warning seems to have gotten less noisy in newer versions;  looking at the enum I think we can silence it with a little cleanup anyway, I tried 1d7bb2bbfa1d.   Let me know if that doesn't help!

https://github.com/llvm/llvm-project/pull/104650


More information about the llvm-commits mailing list