This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: PATCH: Tweak 22_locale to hide more "expected errors"


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

- -- 
- --------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+bXot2ijCOnn/RHQRAhwVAJ9bDduNbJFrV6vb4vzaMpHSGNotdwCguuFH
MMZGUZevJuH8Rfvb4wRTe4g=
=tiWU
-----END PGP SIGNATURE-----


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