AaronBallman wrote:

> Clang defines __BITINT_MAXWIDTH__ for every target, and <limits.h>
defines BITINT_MAXWIDTH from it in C23, but targets that don't support
_BitInt, such as AVR, MSP430, M68k, Xtensa, BPF and VE, reject the
type itself:

This is intentional behavior. Those targets need to be fixed because `_BitInt` 
support is not optional in the C standard but Clang maintainers cannot be the 
ones to define the ABI or width limits for such targets.

> So code that tests for the macro before using the type, as a portable
header might do, fails to compile there instead of falling back to
something else.

If we have users hitting this case, that's our signal that those backends need 
to define the ABI for `_BitInt` and figure out what their supported maximum 
width it. If there's nobody supporting that backend, we need to decide what to 
do with that target (my recommendation would be to considering removing the 
target; it's been three years since C23 was finalized and longer still since 
`_BitInt` was introduced to the working draft, so unmaintained for that length 
of time suggests the target is bit rotting).

https://github.com/llvm/llvm-project/pull/241825
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to