This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

printf optimiziation in gcc-3.2.x


	Hi there,

I wrote my own 'printf()' for an embedded application and after compiling
it with gcc-3.2.2 i got this when i tried to link the objs:

tmp.o(.text+0x9): In function `test':
: undefined reference to `puts'
tmp.o(.text+0x18): In function `test':
: undefined reference to `putchar'

It turned out that gcc is converting 'printf' to 'puts' and 'putchar' and
later the linker can not (of course) find those symbols.  I was using a
command line like:

gcc -Wall -O2 -fomit-frame-pointer -nostdinc -c tmp.c

Tried the same with gcc-2.95 and everything went OK which make me thing it
is a new "feature" in the recent versions of gcc.

Is there a way to turn off this "optimization" or whatever it is?  And btw
why is this the default behavior?


thanks,
Petko


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]