This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: PATCH: Tweak 22_locale to hide more "expected errors"
- From: Ulrich Drepper <drepper at redhat dot com>
- To: rittle at labs dot mot dot com
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, ghazi at caip dot rutgers dot edu, dave at hiauly1 dot hia dot nrc dot ca
- Date: Mon, 10 Mar 2003 21:54:53 -0800
- Subject: Re: PATCH: Tweak 22_locale to hide more "expected errors"
- Organization: Red Hat, Inc.
- References: <200303110547.h2B5ltxl087707@latour.rsch.comm.mot.com>
-----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-----