Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 25731 - strcpy breaks with -O2 -fno-inline
strcpy breaks with -O2 -fno-inline
Product: Red Hat Linux
Classification: Retired
Component: glibc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2001-02-02 11:43 EST by Stefan Sorensen
Modified: 2016-11-24 09:53 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-02-02 11:43:54 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Stefan Sorensen 2001-02-02 11:43:51 EST
$ cat foo.c
#include <string.h>
int main(void)
    char foo[4];
    strcpy(foo, "foo");
    return 0;

$ gcc -O2 -fno-inline foo.c
/tmp/ccLwrlUH.o: In function `main':
/tmp/ccLwrlUH.o(.text+0x5c): undefined reference to `__strcpy_small'
collect2: ld returned 1 exit status

$ rpm -q glibc gcc
Comment 1 Jakub Jelinek 2001-02-02 11:53:50 EST
Pass -O2 -fno-inline -D__NO_STRING_INLINES then. Really, there is nothing
glibc can do about this (apart from exporting all those inlines as static
functions but that makes no sense) and gcc does not pass any macros
which would tell whether -finline or -fno-inline was passed, so it has to use
__OPTIMIZE__ (and has done that for ages).

Note You need to log in before you can comment on or make changes to this bug.