This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with putenv() in global constructor


> I found some strange putenv() function behavior when it's used in a
> global object (C++ code) constructor.  I work on SPARC/Solaris 8
> with g++/gcc version 2.95.3 20010315 (release).  [...]

Hi,

This behavior is outside the scope of anything we can "fix" (unless we
break other global constuctor-related issues).  Your report does not
suprise me.  To be most portable, C++ programs should avoid global
constructors that will invoke library functions traditionally callable
only after main() has been invoked.  The other known trouble spots: You
will find that some systems can't properly allocate any memory before
main() is invoked.  Never attempt to start a POSIX thread before main().

Regards,
Loren


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