[compiler-rt] [compiler-rt] fix gcc 12 support by removing enum-type-specifier (PR #165034)

Yuxuan Chen via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 24 13:59:15 PDT 2025


yuxuanchen1997 wrote:

> Thanks @yuxuanchen1997 for pointing out that using typed enums is c23, I missed that.
> 
> My goal with introducing the enum was to prevent errors like the one I fixed in the PR with CWF. I think we could keep the enum as an argument type, revert to unsigned int in the struct, and cast when calling the function. Would that be okay?

Double checking this... You probably still have ABI issues if the enums are used as arguments to `getIntelProcessorTypeAndSubtype` and `getAMDProcessorTypeAndSubtype`. Having pointers to signed enum as arguments, the two functions will do a signed to signed assignment by treating the argument pointer as one to a signed int, where the caller has passed one to an unsigned int. I think ideally you'd want to preserve that signed to unsigned assignment.

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


More information about the llvm-commits mailing list