All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J.A. Magallon" <jamagallon@able.es>
To: Lista Linux-Kernel <linux-kernel@vger.kernel.org>
Subject: strxxx and gcc-3.4
Date: Sat, 14 Feb 2004 00:40:28 +0100	[thread overview]
Message-ID: <20040213234028.GA3765@werewolf.able.es> (raw)

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

             reply	other threads:[~2004-02-13 23:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-13 23:40 J.A. Magallon [this message]
2004-02-14  0:27 ` strxxx and gcc-3.4 Valdis.Kletnieks
2004-02-17 15:25 ` Maciej W. Rozycki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040213234028.GA3765@werewolf.able.es \
    --to=jamagallon@able.es \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.