Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 05 Sep 2001 11:17:01 +0100
From:      Mark Murray <mark@grondar.za>
To:        Maxim Sobolev <sobomax@FreeBSD.ORG>
Cc:        markm@FreeBSD.ORG (Mark Murray), cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/usr.bin/su Makefile su.c 
Message-ID:  <200109051017.f85AH2k99078@grimreaper.grondar.za>
In-Reply-To: <200109041844.f84Iijw98897@vega.vega.com> ; from Maxim Sobolev <sobomax@FreeBSD.ORG>  "Tue, 04 Sep 2001 21:44:44 %2B0300."
References:  <200109041844.f84Iijw98897@vega.vega.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> > 
> > markm       2001/09/04 10:10:57 PDT
> >
> >[...] 
> >   
> >   This solves the problem (in my own mind) of how a "const char *" _ever_
> >   actually gets a value in a WARNS=2 world.
> 
> const char *foo = "bar"; ???

Right :-).

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?

Like perl's un-tainting, C needs a formal un-consting, and I guess
this is it.

M
-- 
Mark Murray
Warning: this .sig is umop ap!sdn

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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