[PATCH 06/11] locale: Fix UB on insert_weights

Collin Funk collin.funk1@gmail.com
Mon Jun 2 16:33:06 GMT 2025


Florian Weimer <fweimer@redhat.com> writes:

>> Yes, but for -std=gnu11 is still UB and that is what -fsanitize=undefined
>> it catching here.  I think we might change it on the future when/if we
>> bump the standard to use it.
>>
>> Another option would to just enable it for ENABLE_UBSAN, but I think to
>> have --enable-ubsan as a possible option to CI or for development, I 
>> think we should have as minimal as possible issues to better regression
>> evaluation.
>
> What happens if we drop the nonnull annotation of the prototype?  Will
> this change UBSAN behavior today?

I thought about making this change too, but it felt a bit pre-mature
since the behavior is not in a current released standard.

If it fixes UBSAN though, I am for the change.

Collin


More information about the Libc-alpha mailing list