From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30558 invoked by alias); 5 Feb 2002 18:11:52 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 30399 invoked from network); 5 Feb 2002 18:11:40 -0000 Received: from unknown (HELO dell-pe2450-3.cambridge.redhat.com) (195.224.55.225) by sources.redhat.com with SMTP; 5 Feb 2002 18:11:40 -0000 Received: from north-pole.nickc.cambridge.redhat.com (host217-35-28-24.in-addr.btopenworld.com [217.35.28.24]) by dell-pe2450-3.cambridge.redhat.com (Postfix) with ESMTP id 33FFA85390 for ; Tue, 5 Feb 2002 18:11:40 +0000 (GMT) Received: from north-pole.nickc.cambridge.redhat.com.nickc.cambridge.redhat.com (localhost [127.0.0.1]) by north-pole.nickc.cambridge.redhat.com (Postfix) with ESMTP id 19969111C25 for ; Tue, 5 Feb 2002 18:12:16 +0000 (GMT) To: gdb-patches@sources.redhat.com Subject: Confusion over the definition of 'bool' in rdi-share/host.h From: Nick Clifton Date: Tue, 05 Feb 2002 10:11:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-02/txt/msg00119.txt.bz2 Hi Guys, The ARM port of GDB is currently failing to build for me because of this problem: In file included from /home/nickc/work/sources/egcs/gdb/rdi-share/ardi.h:17, from /home/nickc/work/sources/egcs/gdb/remote-rdi.c:46: /home/nickc/work/sources/egcs/gdb/rdi-share/host.h:123: conflicting types for `_Bool' /usr/lib/gcc-lib/i386-redhat-linux/2.96/include/stdbool.h:41: previous declaration of `_Bool' It seems that host.h has code that looks like this (trimmed a little): # define _bool int #ifdef _bool typedef _bool bool; #endif And stdbool.h has: typedef enum { false = 0, true = 1 } _Bool; #define bool _Bool So the typedef in host.h becomes, effectively "typedef int enum _Bool". I am not sure if we are allowed to modify rdi-share/host.h, it appears to be copyright to ARM, but if we are, then may I submit the following patch to undefine bool before it is used ? Cheers Nick 2002-02-05 Nick Clifton * rdi-share/host.h: Before creating a typedef from _bool, make sure that bool is not defined. Index: gdb/rdi-share/host.h =================================================================== RCS file: /cvs/src/src/gdb/rdi-share/host.h,v retrieving revision 1.4 diff -c -3 -p -w -r1.4 host.h *** host.h 2001/06/29 01:19:23 1.4 --- host.h 2002/02/05 17:48:54 *************** typedef unsigned char unsigned8; *** 120,125 **** --- 120,128 ---- # if defined(_MFC_VER) || defined(__CC_NORCROFT) /* When using MS Visual C/C++ v4.2 */ # define bool _bool /* avoids "'bool' is reserved word" warning */ # else + # ifdef bool + # undef bool + # endif typedef _bool bool; # endif # define true _true