From owner-freebsd-arch@FreeBSD.ORG Thu Dec 23 00:22:42 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 A3A1B16A4CE for ; Thu, 23 Dec 2004 00:22:42 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17DE043D53 for ; Thu, 23 Dec 2004 00:22:42 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by wproxy.gmail.com with SMTP id 68so48263wra for ; Wed, 22 Dec 2004 16:22:41 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=d/nuwHlRil23Kv0xJJ/bYCV5UJwTygcM/BwZcDbN9N3x401Zqo5GioYeVMGm6DhJhwuNW6eAg+iFf2IxHW8kj1FPHeeogaQLt5tF4yBzOZoGBmALnPUXNXk6cbcb9/hnp1XccQYA3ofnVQkxrPEGl8ENN4vRYASPhtQJxcRq8dc= Received: by 10.54.45.8 with SMTP id s8mr306891wrs; Wed, 22 Dec 2004 16:22:41 -0800 (PST) Received: by 10.54.57.76 with HTTP; Wed, 22 Dec 2004 16:22:41 -0800 (PST) Message-ID: <34cb7c84041222162210f14238@mail.gmail.com> Date: Thu, 23 Dec 2004 00:22:41 +0000 From: Peter Edwards To: "M. Warner Losh" In-Reply-To: <20041222.115155.71839775.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <34cb7c8404122205002bd7de18@mail.gmail.com> <20041222.113411.76074974.imp@bsdimp.com> <41C9C015.7050706@freebsd.org> <20041222.115155.71839775.imp@bsdimp.com> cc: grog@freebsd.org cc: PeterJeremy@optushome.com.au cc: scottl@freebsd.org 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 Reply-To: Peter Edwards List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2004 00:22:42 -0000 > > Or better yet, just use the array of error values already compiled > into the programs that strerror() formats for you (you don't need to > use strerror, just sys_errlist[]). I'd dispute the "better yet": If used in code, "errno_t" is useful in its own right. Even beyond the type safety, if used in a structure > (gdb) print *structptr Will print errno_t members properly, without requiring hints that fields represent errno values, etc. (ie, it's a hint to the debugger that something of type errno_t conveys more specific information than a value between INT_MIN and INT_MAX.) Although textual descriptions are better than the errno names to users, "err_EBADF" means much more than "9" in a debug output to the programmer running the debugger. Sorry for splitting hairs. (But the bikeshed should definitely be blue) -- Peadar.