From owner-freebsd-current@FreeBSD.ORG Tue Jul 10 21:36:04 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 29E4916A400 for ; Tue, 10 Jul 2007 21:36:04 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mx1.freebsd.org (Postfix) with ESMTP id AC76113C447 for ; Tue, 10 Jul 2007 21:36:03 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.14.1/8.14.1) with ESMTP id l6ALa2d5019244; Wed, 11 Jul 2007 07:36:02 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.14.1/8.14.1/Submit) id l6ALa2mU019243; Wed, 11 Jul 2007 07:36:02 +1000 (EST) (envelope-from peter) Date: Wed, 11 Jul 2007 07:36:02 +1000 From: Peter Jeremy To: Andrey Chernov , freebsd-current@freebsd.org Message-ID: <20070710213602.GX3434@turion.vk2pj.dyndns.org> References: <20070703182400.Q1449@baba.farley.org> <20070709145418.T52164@thor.farley.org> <20070710154148.GA22873@nagual.pp.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mXDO3udm/xYWQeMQ" Content-Disposition: inline In-Reply-To: <20070710154148.GA22873@nagual.pp.ru> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.16 (2007-06-09) Cc: Subject: Re: HEADS UP: getenv() and family API change X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2007 21:36:04 -0000 --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 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--