From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 21 11:52:19 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E428237B401 for ; Mon, 21 Jul 2003 11:52:19 -0700 (PDT) Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0A4CA43F3F for ; Mon, 21 Jul 2003 11:52:19 -0700 (PDT) (envelope-from bicknell@ussenterprise.ufp.org) Received: from ussenterprise.ufp.org (bicknell@localhost [127.0.0.1]) by ussenterprise.ufp.org (8.12.9/8.12.9) with ESMTP id h6LIqH8i061433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Jul 2003 14:52:17 -0400 (EDT) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.12.9/8.12.9/Submit) id h6LIqH3q061432; Mon, 21 Jul 2003 14:52:17 -0400 (EDT) Date: Mon, 21 Jul 2003 14:52:17 -0400 From: Leo Bicknell To: Tim Kientzle Message-ID: <20030721185217.GA60600@ussenterprise.ufp.org> Mail-Followup-To: Tim Kientzle , Chad David , hackers@freebsd.org References: <3F1B0610.90803@acm.org> <20030720225041.GA26277@ussenterprise.ufp.org> <3F1C0C91.6050203@acm.org> <20030721165735.GA56766@ussenterprise.ufp.org> <20030721171538.GA21656@colnta.acns.ab.ca> <20030721172321.GA57666@ussenterprise.ufp.org> <20030721174206.GA21892@colnta.acns.ab.ca> <3F1C2FEB.4070801@acm.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OgqxwSJOaUobr8KG" Content-Disposition: inline In-Reply-To: <3F1C2FEB.4070801@acm.org> Organization: United Federation of Planets X-PGP-Key: http://www.ufp.org/~bicknell/ cc: hackers@freebsd.org cc: Chad David Subject: Re: Correct way to call execve? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jul 2003 18:52:20 -0000 --OgqxwSJOaUobr8KG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In a message written on Mon, Jul 21, 2003 at 11:24:43AM -0700, Tim Kientzle= wrote: > I was hoping that someone knew a standard way to > say "yes, I really do mean to cast away that const," > akin to C++ const_cast. I'm missing something here. You can do that, but you can't do that with say "-Wcast-qual", which is basically a flag to say "I don't care what the code says, tell me about those situations". > Basically, there is no const-correct way to > invoke execvp using literal strings for argv except > to copy the strings. In particular, the > FreeBSD implementation of popen(), for example, cannot be > compiled with strict warnings. Depends on what you call correct. "cc" compiles it quietly. "cc -Wall" compiles quietly. "cc -ansi" compiles quietly. "cc -pedantic" compiles quietly. Sure, there are options you can turn on that show you these /warnings/, but that doesn't mean those options are actually showing you problems with your code. Just because you can run "cc -nostdlib" doesn't mean all code that fails to compile is "broken", it means you used the wrong option. Similarly, if you do things in your program that require constants to not be, then turning on an option to warn you about that seems a bit backwards as well. --=20 Leo Bicknell - bicknell@ufp.org - CCIE 3440 PGP keys at http://www.ufp.org/~bicknell/ Read TMBG List - tmbg-list-request@tmbg.org, www.tmbg.org --OgqxwSJOaUobr8KG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE/HDZhNh6mMG5yMTYRAnIyAJoCkGWGyGcBPYmtYCNKm6M381AyIwCfSRsI TquARh+PNPpGr/nEF1nRkuk= =7RaQ -----END PGP SIGNATURE----- --OgqxwSJOaUobr8KG--