On 20.02.2026 01:56, Marek Marczykowski-Górecki wrote:
> On Fri, Feb 20, 2026 at 01:43:21AM +0100, Marek Marczykowski-Górecki wrote:
>> Archlinux just updated gcc to 15.2.1+r604+g0b99615a8aef-1, and that
>> defaults now to GNU23 standard. This isn't what Xen codebase expects, for
>> example libxl fails to build with:
>>
>>     libxl_cpuid.c: In function ‘libxl_cpuid_parse_config_xend’:
>>     libxl_cpuid.c:447:16: error: assignment discards ‘const’ qualifier from 
>> pointer target type [-Werror=discarded-qualifiers]
>>       447 |         endptr = strchr(str, '=');
>>           |                ^
>>     libxl_cpuid.c:452:16: error: assignment discards ‘const’ qualifier from 
>> pointer target type [-Werror=discarded-qualifiers]
>>       452 |         endptr = strchr(str, ',');
>>           |                ^
>>     libxl_cpuid.c:454:20: error: assignment discards ‘const’ qualifier from 
>> pointer target type [-Werror=discarded-qualifiers]
>>       454 |             endptr = strchr(str, 0);
>>           |                    ^
>>     libxl_cpuid.c: In function ‘libxl_cpuid_parse_config_xend’:
>>     libxl_cpuid.c:447:16: error: assignment discards ‘const’ qualifier from 
>> pointer target type [-Werror=discarded-qualifiers]
>>       447 |         endptr = strchr(str, '=');
>>           |                ^
>>     libxl_cpuid.c:452:16: error: assignment discards ‘const’ qualifier from 
>> pointer target type [-Werror=discarded-qualifiers]
>>       452 |         endptr = strchr(str, ',');
>>           |                ^
>>     libxl_cpuid.c:454:20: error: assignment discards ‘const’ qualifier from 
>> pointer target type [-Werror=discarded-qualifiers]
>>       454 |             endptr = strchr(str, 0);
>>           |                    ^
>>     cc1: all warnings being treated as errors
>>
>> Specify GNU99 explicitly (same version as in the hypervisor, but the
>> GNU dialect), to fix the build, and avoid such surprises in the future.
>>
>> Signed-off-by: Marek Marczykowski-Górecki <[email protected]>
> 
> Hm, I should have tested it more precisely. This actually does not solve
> the issue, it still fails to build on Arch. I did confirmed the
> -std=gnu99 ended up in the relevant GCC call for libxl_cpuid.c.

Is it possible that it's not so much the compiler, but glibc, which is the
problem here?

> So, I guess iterate on v1?

Perhaps. As per above it first needs to become clear where the issue is
actually coming from. Otoh making the code suitably C23-const-correct will
want to happen at some point anyway, I suppose.

Jan

Reply via email to