Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jul 2007 07:36:02 +1000
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Andrey Chernov <ache@nagual.pp.ru>, freebsd-current@freebsd.org
Subject:   Re: HEADS UP:  getenv() and family API change
Message-ID:  <20070710213602.GX3434@turion.vk2pj.dyndns.org>
In-Reply-To: <20070710154148.GA22873@nagual.pp.ru>
References:  <20070703182400.Q1449@baba.farley.org> <Xuu8UV3Bay@dmeyer.dinoex.sub.org> <20070709145418.T52164@thor.farley.org> <20070710154148.GA22873@nagual.pp.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--mXDO3udm/xYWQeMQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2007-Jul-10 19:41:48 +0400, Andrey Chernov <ache@nagual.pp.ru> wrote:
>To say strictly, copying somewhere is not neccessary since this way works=
=20
>too:
>
>static char *s =3D "PATH=3D/bin";
>
>putenv(s);

I thought the C compiler was still free to place the string into RO
memory and/or coalesce it with other strings in that case.

Wouldn't the following be clearer (s is forced to be writable):

static char s[] =3D "PATH=3D/bin";

putenv(s);

--=20
Peter Jeremy

--mXDO3udm/xYWQeMQ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)

iD8DBQFGk/vC/opHv/APuIcRAiGnAJ41L/zJhl2kLTk8F/w8gsVmUSwDCgCfUuKX
S47P8kNAHlEgFCKC1Zv5gyA=
=NaYV
-----END PGP SIGNATURE-----

--mXDO3udm/xYWQeMQ--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070710213602.GX3434>