From owner-freebsd-current@FreeBSD.ORG Tue Jul 10 22:46:22 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 31E1C16A468 for ; Tue, 10 Jul 2007 22:46:22 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (nagual.pp.ru [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id A2C0B13C4C3 for ; Tue, 10 Jul 2007 22:46:21 +0000 (UTC) (envelope-from ache@nagual.pp.ru) Received: from nagual.pp.ru (ache@localhost [127.0.0.1]) by nagual.pp.ru (8.14.1/8.14.1) with ESMTP id l6AMkJhd031890; Wed, 11 Jul 2007 02:46:19 +0400 (MSD) (envelope-from ache@nagual.pp.ru) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nagual.pp.ru; s=default; t=1184107579; bh=tZdmOjxirnuWWIX5nTrGtgWtJExYtMr1ZX5YlSz kICY=; l=1165; h=Received:Date:From:To:Cc:Subject:Message-ID: Mail-Followup-To:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:User-Agent; b=dEfzueZji4+wYSzNIMVR 1g4XGkkCPRIVpc1VowQ3RlP05oEKBquC3hhXli1rqWvq1paKLnQSJdL9gkuWEQC+miY T7q2pALCqMpzk/bSAWXrg7yo2x7nvxeHy6flkOtO/LxkVvnwYatvjhZBe7W/wigqRA0 4O1Q0NAofa7fpMOGY= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l6AMkJm6031889; Wed, 11 Jul 2007 02:46:19 +0400 (MSD) (envelope-from ache) Date: Wed, 11 Jul 2007 02:46:19 +0400 From: Andrey Chernov To: Peter Jeremy Message-ID: <20070710224619.GA31654@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Peter Jeremy , freebsd-current@freebsd.org References: <20070703182400.Q1449@baba.farley.org> <20070709145418.T52164@thor.farley.org> <20070710154148.GA22873@nagual.pp.ru> <20070710213602.GX3434@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1lZvvs/B4yU6o8G" Content-Disposition: inline In-Reply-To: <20070710213602.GX3434@turion.vk2pj.dyndns.org> User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current@freebsd.org 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 22:46:22 -0000 --k1lZvvs/B4yU6o8G Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 11, 2007 at 07:36:02AM +1000, Peter Jeremy wrote: > On 2007-Jul-10 19:41:48 +0400, Andrey Chernov wrote: > >To say strictly, copying somewhere is not neccessary since this way work= s=20 > >too: > > > >static char *s =3D "PATH=3D/bin"; > > > >putenv(s); >=20 > 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. >=20 > Wouldn't the following be clearer (s is forced to be writable): >=20 > static char s[] =3D "PATH=3D/bin"; >=20 > putenv(s); This two are the same, since there is no "const", so compiler can't put=20 static char *s into RO memory. --=20 http://ache.pp.ru/ --k1lZvvs/B4yU6o8G Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFGlAw7Vg5YK5ZEdN0RAjl8AJwJ85GF5IJkES6KLfdndc5gZRlCeACgmmeM HEca1pnei6L5KKkIOGhnxas= =LM8H -----END PGP SIGNATURE----- --k1lZvvs/B4yU6o8G--