From owner-freebsd-arch@FreeBSD.ORG Wed Dec 22 02:03:11 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FFF516A4CE; Wed, 22 Dec 2004 02:03:11 +0000 (GMT) Received: from blackwater.lemis.com (wantadilla.lemis.com [192.109.197.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6259043D39; Wed, 22 Dec 2004 02:03:10 +0000 (GMT) (envelope-from grog@lemis.com) Received: by blackwater.lemis.com (Postfix, from userid 1004) id 879CC8566E; Wed, 22 Dec 2004 12:33:08 +1030 (CST) Date: Wed, 22 Dec 2004 12:33:08 +1030 From: Greg 'groggy' Lehey To: Brian Fundakowski Feldman Message-ID: <20041222020308.GX53357@wantadilla.lemis.com> References: <20041222010143.GS53357@wantadilla.lemis.com> <20041222014314.GB41996@green.homeunix.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uk6W7isEeLAaRh3S" Content-Disposition: inline In-Reply-To: <20041222014314.GB41996@green.homeunix.org> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 cc: FreeBSD Architecture Mailing List Subject: Re: Header files with enums instead of defines? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Dec 2004 02:03:11 -0000 --uk6W7isEeLAaRh3S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 21 December 2004 at 20:43:14 -0500, Brian Fundakowski Feldman wrote: > On Wed, Dec 22, 2004 at 11:31:43AM +1030, Greg 'groggy' Lehey wrote: >> Has anybody thought about replacing #defines with enums in header >> files? It would make debugging a whole lot easier. Foe example, I'm >> currently looking at a debug printout which contains: >> >> xerrno = 17, >> >> To find out what that means, I need to go to >> /usr/src/include/sys/errno.h and look for 17. I find: >> >> #define EEXIST 17 /* File exists */ >> >> If we were to change this to >> >> enum EEXIST = 17; /* File exists */ >> >> I'd then be able to see: >> >> xerrno = EEXIST, >> >> That makes debugging a whole lot easier. About the only down side I >> can see is that you can't #undef an enum. Is this a big deal? > > I think you'll screw up an awful lot of people that #ifdef based upon > the errno names. *sigh* Yes, I didn't think about that. Never mind. Greg -- See complete headers for address and phone numbers. --uk6W7isEeLAaRh3S Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFByNXcIubykFB6QiMRAnIPAJ0UoutKmbc9Z/swL1oUpI5PU7MomQCdF2eA itwxj7+9WLAfAycoXmfHPAU= =gw3y -----END PGP SIGNATURE----- --uk6W7isEeLAaRh3S--