From owner-freebsd-arch@FreeBSD.ORG Wed Dec 22 18:48:55 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 623CC16A4CE; Wed, 22 Dec 2004 18:48:55 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0158343D31; Wed, 22 Dec 2004 18:48:55 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id iBMImB1P023642; Wed, 22 Dec 2004 11:48:11 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 22 Dec 2004 11:48:35 -0700 (MST) Message-Id: <20041222.114835.65987539.imp@bsdimp.com> To: scottl@FreeBSD.org From: "M. Warner Losh" In-Reply-To: <41C9C015.7050706@freebsd.org> References: <34cb7c8404122205002bd7de18@mail.gmail.com> <20041222.113411.76074974.imp@bsdimp.com> <41C9C015.7050706@freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: grog@FreeBSD.org cc: PeterJeremy@optushome.com.au 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 18:48:55 -0000 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. : > : > Warner : : 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"? Warner