printf() as a macro in glibc 2.2.1?
Craig Rodrigues
rodrigc@mediaone.net
Thu Jan 18 17:43:00 GMT 2001
Hi,
I am using gcc version:
gcc version 2.97 20001005 (experimental)
I am running:
/lib/libc.so.6
============================================================================
GNU C Library stable release version 2.2.1, by Roland McGrath et al.
Copyright (C) 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 2.96 20000731 (Red Hat Linux 7.0).
Compiled on a Linux 2.4.0-0.43.6 system on 2001-01-15.
Available extensions:
GNU libio by Per Bothner
crypt add-on version 2.1 by Michael Glad and others
The C stubs add-on version 2.1.2.
BIND-8.2.3-T5B
NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Glibc-2.0 compatibility add-on by Cristian Gafton
linuxthreads-0.9 by Xavier Leroy
libthread_db work sponsored by Alpha Processor Inc
============================================================================
In /usr/include/bits/stdio.h, I found this code:
============================================================================
/* Since version 2.97 GCC knows about `fprintf' and can optimize certain
cases. Help gcc to optimize more code by mapping `printf' to the known
`fprintf' function. Unfortunately we have to use a macro. */
# if __GNUC_PREREQ (2,97)
# define printf(fmt, args...) fprintf (stdout, fmt, ##args)
# endif
============================================================================
This particular piece of code is breaking my compilation of the ACE
C++ library ( http://www.cs.wustl.edu/~schmidt/ACE.html ), which has
an OS encapsulation layer for standard C functions.
Is this code snippet going to say in, or is it going away?
Considering that gcc 2.97 is an interim version number of gcc, I'm not
sure if it is a good idea to put macros which are conditionally activated
on depending on what version of gcc is used.
If this code snippet is staying in glibc, then I need to write
a workaround for my code.
Thanks.
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net
More information about the Libc-alpha
mailing list