Re: How to override standard printf defined in gcc library

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

 



RahulJain83 wrote:
Above code works fine for following fprintf calls (that pass variable
argument list to fprintf) -

fprintf (stdout,"This is a variable argument message - %s\n", "Rahul Jain");

However, for following fprintf call (that is not taking any variable
arguments), it seems fprintf from libgcc is getting picked up as then print
comes on the screen instead of our Graphical interface window -

fprintf (stdout,"This is a variable argument message - Rahul Jain\n");

I am not sure why this is happening. Is fprintf implemented as macro, such
that it is working for case1 and not for case2. Can anybody help.
Please check that those 'printf()'s haven't been changed to 'puts()'s ! Sometimes I found out that GCC produces a call to 'puts()' instead of 'printf()' with the simple "Hello World" program... Why it does this kind of optimization, is unclear but when this happens, doing something similar with 'puts()'
could be your workaround...

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux