]> git.hungrycats.org Git - linux/commit
[PATCH] string fixes for gcc 3.4
authorAndrew Morton <akpm@osdl.org>
Wed, 4 Feb 2004 02:32:36 +0000 (18:32 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Wed, 4 Feb 2004 02:32:36 +0000 (18:32 -0800)
commitc545699aca137204c9e435f2be70cda0723c92c5
tree77ded8e1d87dea53191cd0cb3492899276e0b3be
parentd75cb1840b2c95fcfa740a9e6b350ae44c9fbb46
[PATCH] string fixes for gcc 3.4

From: Andi Kleen <ak@muc.de>

gcc 3.4 optimizes sprintf(foo,"%s",string) into strcpy.  Unfortunately that
isn't seen by the inliner and linux/i386 has no out-of-line strcpy so you
end up with a linker error.

This patch adds out of line copies for most string functions to avoid this.
Actually it doesn't export them to modules yet, that would be the next
step.

BTW In my opinion we shouldn't use inline string functions at all.  The
__builtin_str* in modern gcc are better (I used them very successfully on
x86-64) and for the bigger functions like strrchr,strtok et.al.  it just
doesn't make any sense to inline them or even code them in assembler.

Also fix the bcopy prototype gcc was complaining about.
include/asm-i386/string.h
lib/string.c