From owner-freebsd-hackers@FreeBSD.ORG Sun Jul 20 15:50:43 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 86FD837B401 for ; Sun, 20 Jul 2003 15:50:43 -0700 (PDT) Received: from ussenterprise.ufp.org (ussenterprise.ufp.org [208.185.30.210]) by mx1.FreeBSD.org (Postfix) with ESMTP id C50B043F93 for ; Sun, 20 Jul 2003 15:50:42 -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 h6KMog8i026583 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 20 Jul 2003 18:50:42 -0400 (EDT) Received: (from bicknell@localhost) by ussenterprise.ufp.org (8.12.9/8.12.9/Submit) id h6KMofuW026582 for hackers@freebsd.org; Sun, 20 Jul 2003 18:50:41 -0400 (EDT) Date: Sun, 20 Jul 2003 18:50:41 -0400 From: Leo Bicknell To: hackers@freebsd.org Message-ID: <20030720225041.GA26277@ussenterprise.ufp.org> Mail-Followup-To: hackers@freebsd.org References: <3F1B0610.90803@acm.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <3F1B0610.90803@acm.org> Organization: United Federation of Planets X-PGP-Key: http://www.ufp.org/~bicknell/ 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: Sun, 20 Jul 2003 22:50:43 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In a message written on Sun, Jul 20, 2003 at 02:13:52PM -0700, Tim Kientzle= wrote: > If I declare argv as "const char *", > then the call to execve() warns about > "incompatible pointer type" for the > second argument. Almost, but the other order is important here, this passes gcc -Wall: #include #include int main(int argc, char *const argv[], char *const envp[]) { char *const execargv[] =3D { _PATH_BSHELL, NULL }; execve(_PATH_BSHELL,execargv,envp); return 0; } --=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 --OXfL5xGRrasGEqWY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE/GxzBNh6mMG5yMTYRAkQCAJoDyjQr2QDxYPCdWNSORhHRBatDIgCfT5v5 FdkH53v4u5HDkGvOVBVU6Ss= =UjGZ -----END PGP SIGNATURE----- --OXfL5xGRrasGEqWY--