lkml.org 
[lkml]   [2002]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [TRIVIAL] strlen("literal string") -> (sizeof("literal string")-1)
From
Date
Linus Torvalds <torvalds@transmeta.com> writes:

> 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..

It does a better job for near all the string.h stuff. x86-64 just uses
the builtins. Only exception is memcpy, where it likes to call out of line
memcpy when it is not absolutely sure about all the alignments
(especally lots of casting causes that)

Still having an empty (or the one from x86-64 ;) string.h should be fine.

-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.038 / U:5.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site