Re: [TRIVIAL] strlen("literal string") -> (sizeof("literal string")-1)

Linus Torvalds
2002-08-29T16:45:51Z

On Thu, 29 Aug 2002, Jakub Jelinek wrote:
>
> Well, IMHO at least for the more recent GCC versions kernel
> should leave the job to GCC (ie. either just prototype str* functions,
> or define them to __builtin_str* variants).

I agree. That x86 strlen() inline is from 1991 with fixes ever after, and
pre-dates gcc having any support for inline at all. We're much more likely
to be better off just removing it these days. Is somebody willing to
compare code quality? I wouldn't be in the least surprised if gcc did a
better job these days..

Linus