[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#37295: fno-inline causes strcpy(foo, "") to break

On Fri, May 07, 1999 at 04:00:58PM +0000, Lars Wirzenius wrote:
> As far as I can determine, it is strictly conforming standard C. If I compile
> it without -fno-inline, the following happens:
> $ gcc -O foo.c
> $ ./a.out
> s=.
> Ergo, it works as it should. If I use -fno-inline, however, it fails to work:
> $ gcc -O -fno-inline foo.c
> /tmp/cc49Syvn.o: In function `main':
> /tmp/cc49Syvn.o(.text+0x91): undefined reference to `__strcpy_small'
> collect2: ld returned 1 exit status
> As far as I understand, I should be able to use -fno-inline. The problem,
> I think, is due to how /usr/include/string.h and/or /usr/include/bits/string2.h
> decide on whether to use a macro of strcpy that expands to a call to
> __strcpy_small in some circumstances.

As a temporary fix, add -D__NO_STRING_INLINES to the command line. 
Does gcc define a macro for the presence/absence of inline functions? 
Or is this where the 'extern inline' trick came in?


/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|     CMU, CS class of 2002      |
|   Debian GNU/Linux Developer    __   Part-Time Systems Programmer  |
|         dan@debian.org         |  |        drow@cs.cmu.edu         |
\--------------------------------/  \--------------------------------/

Reply to: