This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


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

Re: glibc 2.1.1pre2 breaks libstdc++-v3 build


 > From: Ulrich Drepper <drepper@redhat.com>
 > 
 > "Joseph S. Myers" <jsm28@cam.ac.uk> writes:
 > 
 > > (a) Is this really a good idea, or should such changes printf -> fprintf
 > > not rather be achieved by extracting "stdout" somehow (as discussed on the
 > > gcc lists from time to time) in GCC?
 > 
 > No.  Stdout is defined to be a macro which the compiler cannot know about.


As I mentioned in my last message, you can capture the definition of a
macro inside an inline function:

 > extern __inline__ FILE *__builtin_stdout(void) { return stdout; }

Then you'd be essentially doing this transformation:
printf(...) -> fprintf(__builtin_stdout(), ...)


Alternatively, it occurs to me that since gcc now has an integrated
preprocessor, I bet you could grab the definition of stdout directly
from cpplib.  But I haven't investigated that at all, yet...

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

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