From owner-freebsd-hackers@FreeBSD.ORG Mon Jul 21 10:23:24 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 0694B37B401 for ; Mon, 21 Jul 2003 10:23:24 -0700 (PDT) Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3030543F3F for ; Mon, 21 Jul 2003 10:23:23 -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 h6LHNL8i057971 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 21 Jul 2003 13:23:21 -0400 (EDT) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.12.9/8.12.9/Submit) id h6LHNLLq057970; Mon, 21 Jul 2003 13:23:21 -0400 (EDT) Date: Mon, 21 Jul 2003 13:23:21 -0400 From: Leo Bicknell To: hackers@freebsd.org Message-ID: <20030721172321.GA57666@ussenterprise.ufp.org> Mail-Followup-To: hackers@freebsd.org, Tim Kientzle 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> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99" Content-Disposition: inline In-Reply-To: <20030721171538.GA21656@colnta.acns.ab.ca> Organization: United Federation of Planets X-PGP-Key: http://www.ufp.org/~bicknell/ cc: Tim Kientzle 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 17:23:24 -0000 --5vNYLRcllDrimb99 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:15:38AM -0600, Chad David w= rote: > Try cc -Wwrite-strings -Wcast-qual exec.c. >=20 > You cannot simply cast away a const. Grumble, will someone give me all the warnings you want turned on so I can work around all of them? :) % cat exec.c #include #include #include int main(int argc, char *const argv[], char *const envp[]) { char *const execargv[] =3D { strdup(_PATH_BSHELL), strdup(NULL) }; execve(_PATH_BSHELL,execargv,envp); return 0; } % cc -Wwrite-strings -Wcast-qual exec.c % cc -Wall exec.c --=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 --5vNYLRcllDrimb99 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE/HCGJNh6mMG5yMTYRAnNgAJ42vjyWK9d5qM3Krjm2fMIK3YY36gCdHADI OhuQhy6x/6VlYLWh0C2ZrHQ= =MSyT -----END PGP SIGNATURE----- --5vNYLRcllDrimb99--