From owner-freebsd-bugs Sat Nov 18 1: 0: 8 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 4A53E37B4C5 for ; Sat, 18 Nov 2000 01:00:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id BAA26312; Sat, 18 Nov 2000 01:00:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from cae88-102-101.sc.rr.com (unknown [24.88.102.101]) by hub.freebsd.org (Postfix) with ESMTP id E3CB037B479 for ; Sat, 18 Nov 2000 00:50:23 -0800 (PST) Received: (from myself@localhost) by cae88-102-101.sc.rr.com (8.11.1/8.9.3) id eAI8oOt50089; Sat, 18 Nov 2000 03:50:24 -0500 (EST) (envelope-from myself) Message-Id: <200011180850.eAI8oOt50089@cae88-102-101.sc.rr.com> Date: Sat, 18 Nov 2000 03:50:24 -0500 (EST) From: Donald.J.Maddox@cae88-102-101.sc.rr.com Reply-To: dmaddox@sc.rr.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: misc/22936: broken, needs repair Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 22936 >Category: misc >Synopsis: /usr/include/stdbool.h defines _bool twice when included by gcc. >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Nov 18 01:00:00 PST 2000 >Closed-Date: >Last-Modified: >Originator: Donald J. Maddox >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: System: FreeBSD cae88-102-101.sc.rr.com 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Nov 15 00:22:26 EST 2000 root@cae88-102-101.sc.rr.com:/usr/src/sys/compile/RHIANNON i386 >Description: The header file contains a defective conditional that breaks several ports. Any code that includes will break if compiled by gcc... Example: #include int main() { return(0); } $ cc test.c In file included from test.c:1: /usr/include/stdbool.h:51: conflicting types for `_Bool' /usr/include/stdbool.h:38: previous declaration of `_Bool' >How-To-Repeat: See above :) >Fix: --- /usr/src/include/stdbool.h Sat Sep 16 03:28:44 2000 +++ stdbool.h.new Sat Nov 18 03:23:55 2000 @@ -31,11 +31,15 @@ #ifndef _STDBOOL_H_ #define _STDBOOL_H_ +#if __STDC_VERSION__ < 199901L +typedef int _Bool; /* not built into pre-C99 compilers */ +#else /* `_Bool' type must promote to `int' or `unsigned int' */ typedef enum { false = 0, true = 1 } _Bool; +#endif /* And those constants must also be available as macros */ #define false false @@ -46,9 +50,5 @@ /* Inform that everything is fine */ #define __bool_true_false_are_defined 1 - -#if __STDC_VERSION__ < 199901L -typedef int _Bool; /* not built into pre-C99 compilers */ -#endif #endif /* _STDBOOL_H_ */ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message