[PATCH v2] Implement C23 const-preserving standard library macros

Collin Funk collin.funk1@gmail.com
Wed Nov 19 18:16:36 GMT 2025


Paul Eggert <eggert@cs.ucla.edu> writes:

> On 2025-11-19 09:37, Collin Funk wrote:
>> Wouldn't this break a ton of existing code since HAYSTACK is evaluated
>> multiple times [1]?
>
> Shouldn't be a problem for correct programs. _Generic doesn't evaluate
> its first argument; it merely uses the argument's type.

Thanks to you and Joseph for clarifying that. I have used _Generic very
few times, clearly.

This change seems fine then. I think the warnings are fine, but making
them less noisy and more clear is always an improvement.

Collin


More information about the Libc-alpha mailing list