This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
printf before main?
- From: Brendan Miller <catphive at catphive dot net>
- To: libc-help at sourceware dot org
- Date: Tue, 23 Mar 2010 13:20:22 -0700
- Subject: printf before main?
Is it safe to call printf family functions, or other streams
functionality before main? In other words, in global C++ constructors,
or functions with __attribute__((constructor))?
I'm wondering if any buffers for standard output are being allocated
during that phase... I need to do some output potentially before main
for logging purposes, and I'm wondering if I'd better off calling
write directly.
Brendan