From owner-freebsd-arch@FreeBSD.ORG Wed Dec 22 18:43:01 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 D200A16A4CE; Wed, 22 Dec 2004 18:43:01 +0000 (GMT) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2892543D2F; Wed, 22 Dec 2004 18:43:01 +0000 (GMT) (envelope-from scottl@freebsd.org) Received: from [192.168.254.11] (junior-wifi.samsco.home [192.168.254.11]) (authenticated bits=0) by pooker.samsco.org (8.12.11/8.12.10) with ESMTP id iBMIkUPx084636; Wed, 22 Dec 2004 11:46:30 -0700 (MST) (envelope-from scottl@freebsd.org) Message-ID: <41C9C015.7050706@freebsd.org> Date: Wed, 22 Dec 2004 11:42:29 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.2) Gecko/20040929 X-Accept-Language: en-us, en MIME-Version: 1.0 To: "M. Warner Losh" References: <20041222090855.GO79646@cirb503493.alcatel.com.au> <20041222103844.GI801@straylight.m.ringlet.net> <34cb7c8404122205002bd7de18@mail.gmail.com> <20041222.113411.76074974.imp@bsdimp.com> In-Reply-To: <20041222.113411.76074974.imp@bsdimp.com> X-Enigmail-Version: 0.86.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, hits=0.0 required=3.8 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on pooker.samsco.org 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:43:02 -0000 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. Scott