From owner-cvs-all Thu Sep 6 8:50:17 2001 Delivered-To: cvs-all@freebsd.org Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by hub.freebsd.org (Postfix) with SMTP id D5CA537B408; Thu, 6 Sep 2001 08:50:11 -0700 (PDT) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 6 Sep 2001 16:49:47 +0100 (BST) Date: Thu, 6 Sep 2001 16:49:46 +0100 From: David Malone To: Mark Murray Cc: Maxim Sobolev , markm@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/usr.bin/su Makefile su.c Message-ID: <20010906164946.A94377@walton.maths.tcd.ie> References: <200109041844.f84Iijw98897@vega.vega.com> <200109051017.f85AH2k99078@grimreaper.grondar.za> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200109051017.f85AH2k99078@grimreaper.grondar.za>; from mark@grondar.za on Wed, Sep 05, 2001 at 11:17:01AM +0100 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Now how do you get (variable) stuff into a 'const char *'? > > For example - a function is not allowed to modify its arguments, so > they are const, but the stuff being passed in is by no means constant. > That one is easy - you can pass a 'foo *' into a 'const foo *'. Now, > how do you build up a 'const foo *' in such a way that you can, but > nobody else can? You build it up in a char * and then assign it to a const char *. Or am I missing something? (There are some more compilcated issues with constness with functions like strchr. It takes a const char * and derives a char *, its return value, from it.) David. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message