Alejandro Colomar wrote: > > strchr is a red herring, because this way to define strnul is compiled > > less efficiently than (s + strlen (s)). See attached example code. > > Not really. At -O1, both GCC and Clang produce the same exact code:
Not all versions of GCC and clang do so. See the comments in the file 'foo.c' that I had attached. Bruno
