From owner-freebsd-current@FreeBSD.ORG Sun Jul 8 14:59:46 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 E336016A46B for ; Sun, 8 Jul 2007 14:59:46 +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 6411C13C457 for ; Sun, 8 Jul 2007 14:59:45 +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 l68ExG7J089033; Sun, 8 Jul 2007 18:59:16 +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=1183906757; bh=nq7z6bROJanaYhpI9bE2bq2JXhuX9+s8Wfa4zM3 QCl8=; l=772; 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=GEsGQVPC9MWTr4lEVi9t uxrSm6engFj+iyhQGp02XrfdmQGEtHkPpNSTrFk6C1ocVBMXcxr2lHfk+UTQi2Nwvt0 vZbOPYbSnNms0fnVPa9QjXBMnjixuleNN3tkD7EWh97WSA8l7GutVwQ7dP3VDvLVyRv ir+8gkFabimQGi9og= Received: (from ache@localhost) by nagual.pp.ru (8.14.1/8.14.1/Submit) id l68ExGgB089031; Sun, 8 Jul 2007 18:59:16 +0400 (MSD) (envelope-from ache) Date: Sun, 8 Jul 2007 18:59:16 +0400 From: Andrey Chernov To: Dirk Meyer Message-ID: <20070708145916.GA88793@nagual.pp.ru> Mail-Followup-To: Andrey Chernov , Dirk Meyer , freebsd-current@freebsd.org References: <20070703182400.Q1449@baba.farley.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Sun, 08 Jul 2007 14:59:47 -0000 On Sun, Jul 08, 2007 at 04:13:49PM +0200, Dirk Meyer wrote: > Hallo Sean C. Farley, > > > Changes in moving to POSIX from historic BSD API: > > b. putenv takes a char * instead of const char *. > > c. putenv no longer makes a copy of the input string. > > Can you give more details? > See POSIX description http://www.opengroup.org/onlinepubs/009695399/functions/putenv.html > An application will break in using this: > putenv("PATH=/bin") > > now taking a char *, this will break with gcc42. No break, this is illegal call (because this const _contents_ may be changed with the yet one putenv call). Why do you think gcc uses tlink.c: putenv (xstrdup ("COMPILER_PATH=")); in its own internal code? (like many others) -- http://ache.pp.ru/