[PATCH v1] ppc64le: Power 10 rawmemchr clobbers v20 (bug #33091)

Sachin Monga smonga@linux.ibm.com
Fri Oct 24 18:27:30 GMT 2025


On 22/10/25 10:01 pm, Cristian Rodríguez wrote:
> Yes, it is applications that need to be changed to just call memchr
> instead and avoid this non-standard interface that may cause UB..this
> interface needs a [[deprecated]]  so
> developers are aware of this..
> rawmemchr(s, '\0');
> to
> memchr(s, 0, ..)
> which the compiler will expand to s + strlen(s) (if s is known at
> compile time it will be optimized out completely..)

Cristian

Thank you for your detailed feedback and for highlighting the broader 
context around rawmemchr. I agree that moving toward standard interfaces 
like memchr makes sense for long-term maintainability and to avoid 
potential UB. Marking rawmemchr as [[deprecated]] to guide developers 
toward memchr sounds like a reasonable step.

That said, since rawmemchr is still used for binary compatibility , I 
guess it may be required for existing applications also.

Therefore, for now, I am upstreaming this minor change. However, if 
community feels that rawmemchr needs to be [[ deprecated ]] , then I'll 
do the required change also.

Regards: Sachin.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20251024/10b5efc1/attachment.htm>


More information about the Libc-alpha mailing list