This is the mail archive of the
mailing list for the glibc project.
printf() as a macro in glibc 2.2.1?
- To: libc-alpha at sources dot redhat dot com
- Subject: printf() as a macro in glibc 2.2.1?
- From: Craig Rodrigues <rodrigc at mediaone dot net>
- Date: Thu, 18 Jan 2001 20:43:32 -0500
I am using gcc version:
gcc version 2.97 20001005 (experimental)
I am running:
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
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.
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.
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)
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.