On 11/20/25 8:27 AM, Christoph Müllner wrote: > In the discussion of this feature in the RISC-V C API PR [1], Craig > brought up a compatibility issue: > "Developer writes code for RVA23U64 today. > In the future the code is compiled with RVA30U64 that is superset of RVA23U64. > __riscv_rva23u64 macro is not defined because __riscv_rva30u64. > Code no longer does the correct thing and must be updated to check for > __riscv_rva30u64 OR __riscv_rva23u64." > > Zhongyao agreed that this is an issue. > Kito then proposed to define all test macros whose extensions are enabled.
I strongly agree with Kito. This is how other architectures work. The macros like __riscv_rva23u64 shouldn't be thought of as the compiler options used exactly match -march=rva23u64, but that the compiler options being used have enabled all the features required by RVA23U64. Therefore, if someone compiled with -march=rva30u64, then that clearly implies all the RVA23U64 features are enabled and the macro should be true. Hopefully we won't see any required (as opposed to optional) extension in a profile being deprecated in some future profile. But we can cross that bridge when we come to it. Peter
