From owner-freebsd-arch@FreeBSD.ORG Wed Dec 22 23:11:21 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 35B1716A4CE; Wed, 22 Dec 2004 23:11:21 +0000 (GMT) Received: from blackwater.lemis.com (wantadilla.lemis.com [192.109.197.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F49E43D2F; Wed, 22 Dec 2004 23:11:18 +0000 (GMT) (envelope-from grog@lemis.com) Received: by blackwater.lemis.com (Postfix, from userid 1004) id 4905285607; Thu, 23 Dec 2004 09:41:08 +1030 (CST) Date: Thu, 23 Dec 2004 09:41:08 +1030 From: Greg 'groggy' Lehey To: "M. Warner Losh" Message-ID: <20041222231108.GC53357@wantadilla.lemis.com> References: <34cb7c8404122205002bd7de18@mail.gmail.com> <20041222.113411.76074974.imp@bsdimp.com> <41C9C015.7050706@freebsd.org> <20041222.114835.65987539.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HsYKTmaHn9HHfM39" Content-Disposition: inline In-Reply-To: <20041222.114835.65987539.imp@bsdimp.com> 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: PeterJeremy@optushome.com.au cc: scottl@FreeBSD.org cc: peadar.edwards@gmail.com cc: arch@FreeBSD.org 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 23:11:21 -0000 --HsYKTmaHn9HHfM39 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wednesday, 22 December 2004 at 11:48:35 -0700, M. Warner Losh wrote: > In message: <41C9C015.7050706@freebsd.org> > Scott Long writes: >> M. Warner Losh wrote: >>> In order to gain the benefits of the enums, errno would need to be an >>> enum errno_t or some such. This breaks C++ code that sets errno = 0, >>> since you can't assign integers to errno values. >>> >>> So even if you retained EBOGUS or whatever, this wouldn't work with >>> C++. errno has to be an int to work there. >> >> I think you might have missed that nothing was actually being declared >> with the errno_t type, but rather the type was used as a cast for gdb. >> It's a neat trick, but still a little cumbersome unless gdb was taught >> about it or given some clever macros. > > Then why bother... Is typing something complex to gdb really better > than "grep $number /usr/include/sys/errno.h"? No, but getting it automatically is. Greg -- See complete headers for address and phone numbers. --HsYKTmaHn9HHfM39 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFByf8MIubykFB6QiMRArX7AJ47MlwbqTE9WYNWxTSwQLzc7eiBdgCfROcS s60DULRWescSNza2/ljds9c= =Ys2b -----END PGP SIGNATURE----- --HsYKTmaHn9HHfM39--