This is the mail archive of the
mailing list for the GDB project.
Re: Confusion over the definition of 'bool' in rdi-share/host.h
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: Nick Clifton <nickc at cambridge dot redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com, Richard dot Earnshaw at arm dot com
- Date: Wed, 06 Feb 2002 10:55:55 +0000
- Subject: Re: Confusion over the definition of 'bool' in rdi-share/host.h
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
> 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;
> 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 ?
the rdi's host.h is really a non-autoconf approach to generating host
definitions. It's contents should really be replaced with an include of
the standard autoconf generated definitions followed by some cleanups (ie
defining the types that the rdi code need in terms of what autoconf has
provided) to make the rest of the rdi files compile cleanly.