public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* strxxx and gcc-3.4
@ 2004-02-13 23:40 J.A. Magallon
  2004-02-14  0:27 ` Valdis.Kletnieks
  2004-02-17 15:25 ` Maciej W. Rozycki
  0 siblings, 2 replies; 3+ messages in thread
From: J.A. Magallon @ 2004-02-13 23:40 UTC (permalink / raw)
  To: Lista Linux-Kernel

Hi all...

Finally I got the problem with emu10k1. It was a sprintf->strcpy that
the compiler could not inline. And out-of-line strcpy was not exported.
Exporting it solved the problem (in -mm tree, that has the out-of-line
versions).

Current situation: even -mm, that includes many fixes for gcc-3.4, can
fail to build. Currently in 2.6.3-rc2-mm1 there are:

werewolf:/usr/src/linux-2.6.3-rc2-mm1# grep -r sprintf * | grep \"%s\" | wc -l
63

instances of that stupid sprintf(s,"%s", .... ) thing.

Options:
- Fix all of them. I don't like it, the kernel should not depend on what
  gcc does internally
- Use -fno-builtin-sprintf. I think gcc swaps sprintf to strcpy because
  it sees it as a builtin, but as finds a declaration for an external
  strcpy does not use the builtin for strcpy.
- Kill off all str/mem functions and just let gcc insert builtins.

  info for gcc-3.3 says:

   The ISO C90 functions `abs', `cos', `exp', `fabs', `fprintf',
`fputs', `labs', `log', `memcmp', `memcpy', `memset', `printf',
`putchar', `puts', `scanf', `sin', `snprintf', `sprintf', `sqrt',
`sscanf', `strcat', `strchr', `strcmp', `strcpy', `strcspn', `strlen',
`strncat', `strncmp', `strncpy', `strpbrk', `strrchr', `strspn',
`strstr', `vprintf' and `vsprintf' are all recognized as built-in
functions unless `-fno-builtin' is specified (or
`-fno-builtin-FUNCTION' is specified for an individual function).  All
of these functions have corresponding versions prefixed with
`__builtin_'.

  info for gcc-3.4

   The ISO C90 functions `abort', `abs', `acos', `asin', `atan2',
`atan', `calloc', `ceil', `cosh', `cos', `exit', `exp', `fabs',
`floor', `fmod', `fprintf', `fputs', `frexp', `fscanf', `labs',
`ldexp', `log10', `log', `malloc', `memcmp', `memcpy', `memset',
`modf', `pow', `printf', `putchar', `puts', `scanf', `sinh', `sin',
`snprintf', `sprintf', `sqrt', `sscanf', `strcat', `strchr', `strcmp',
`strcpy', `strcspn', `strlen', `strncat', `strncmp', `strncpy',
`strpbrk', `strrchr', `strspn', `strstr', `tanh', `tan', `vfprintf',
`vprintf' and `vsprintf' are all recognized as built-in functions unless
`-fno-builtin' is specified (or `-fno-builtin-FUNCTION' is specified
for an individual function).  All of these functions have corresponding
versions prefixed with `__builtin_'.

So at least the common interesting things are
 `memcmp', `memcpy', `memset'
 `strcat', `strchr', `strcmp', `strcpy', `strcspn', `strlen',
 `strncat', `strncmp', `strncpy', `strpbrk', `strrchr', `strspn', `strstr', 
 `sprintf', `snprintf', `sscanf', `vsprintf'

Preferences ?

-- 
J.A. Magallon <jamagallon()able!es>     \                 Software is like sex:
werewolf!able!es                         \           It's better when it's free
Mandrake Linux release 10.0 (RC1) for i586
Linux 2.6.3-rc2-jam1 (gcc 3.4.0 (Mandrake Linux 10.0 3.4.0-0.1mdk))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-17 15:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-13 23:40 strxxx and gcc-3.4 J.A. Magallon
2004-02-14  0:27 ` Valdis.Kletnieks
2004-02-17 15:25 ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox