From owner-freebsd-bugs Sat Nov 18 10:40:10 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 01BBE37B479 for ; Sat, 18 Nov 2000 10:40:04 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id KAA01257; Sat, 18 Nov 2000 10:40:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Date: Sat, 18 Nov 2000 10:40:03 -0800 (PST) Message-Id: <200011181840.KAA01257@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: "Donald J . Maddox" Subject: Re: misc/22936: broken, needs repair Reply-To: "Donald J . Maddox" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR misc/22936; it has been noted by GNATS. From: "Donald J . Maddox" To: Bruce Evans Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: misc/22936: broken, needs repair Date: Sat, 18 Nov 2000 13:39:09 -0500 Thanks. Are you going to commit your fix and close the PR? On Sun, Nov 19, 2000 at 04:18:45AM +1100, Bruce Evans wrote: > On Sat, 18 Nov 2000 Donald.J.Maddox@cae88-102-101.sc.rr.com wrote: > > > >Description: > > The header file contains a defective > > conditional that breaks several ports. Any code that includes > > will break if compiled by gcc... Example: > > Much more is broken than that, at least according to a C99 draft (n869). > 1) _Bool is a first class type (like int), so it can't be declared as > a typedef (unless compiler magic supports such a declaration). > 2) `true' and `false' are supposed to be usable in cpp expressions, so > they can't be declared as enum values. > 3) The definitions of `false' and `true' as themself don't work in K&R > mode. This is not a serious bug, since K&R code shouldn't include > . > 4) Support for the Standard C (c99) _Bool is premature, since gcc doesn't > support _Bool as a first class type. > > is essentially a compatibility hack for pre-c99 compilers. > The current version seems to be based on the gcc version. Both versions > will break when gcc actually supports _Bool. > > Here is a version compatible with the C99 draft and K&R: > > --- > #define __bool_true_false_are_defined 1 > #define false 0 > #define true 1 > > #define bool _Bool > #if __STDC_VERSION__ < 199901L > typedef int _Bool; > #endif > --- > > Bruce > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message