RE: [PATCH 0/1] tools/nolibc/string: export strlen()

From: David Laight
Date: Sat Jan 27 2024 - 16:23:33 EST


.
> Yes, once we have the proof that the compiler may produce such a call, it
> can also happen in whatever user code so we need to export the function,
> there's no other solution.

Does that mean that it you try to implement strlen() in C
gcc will generate a recursive call?

I guess an 'asm volatile("");' in the loop fix it.
Although, IIRC, you need a comment in the asm - and there
isn't a portable comment.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)