Date: Thu, 23 Dec 2004 09:41:08 +1030 From: Greg 'groggy' Lehey <grog@FreeBSD.org> To: "M. Warner Losh" <imp@bsdimp.com> Cc: arch@FreeBSD.org Subject: Re: Header files with enums instead of defines? Message-ID: <20041222231108.GC53357@wantadilla.lemis.com> In-Reply-To: <20041222.114835.65987539.imp@bsdimp.com> References: <34cb7c8404122205002bd7de18@mail.gmail.com> <20041222.113411.76074974.imp@bsdimp.com> <41C9C015.7050706@freebsd.org> <20041222.114835.65987539.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <scottl@freebsd.org> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041222231108.GC53357>