PATCH: Tweak 22_locale to hide more "expected errors"

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Thu Mar 13 15:44:00 GMT 2003


 > From: Ulrich Drepper <drepper@redhat.com>
 > 
 > Loren James Rittle wrote:
 > 
 > > Now, a basic improvement might be to support putenv() when it is
 > > available and setenv() was not available (Kaveh wrote that putenv() is
 > > more portable;
 > 
 > Using putenv() is almost always wrong.  Read the specs of the function.
 >  The string passes as the argument is added to the environment.  Not a
 > copy, the string itself.  If the string is allocated on the stack the
 > frame mustn't be left.  If it's dynamically allocated the memory might
 > leak when the entry gets replaced.
 > 
 > Use setenv() and ignore this bad advise.

This is a red herring.  We're talking about what to do when setenv is
not available.

--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu



More information about the Libstdc++ mailing list