This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Confusion over the definition of 'bool' in rdi-share/host.h
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Nick Clifton <nickc at cambridge dot redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 5 Feb 2002 13:59:14 -0500
- Subject: Re: Confusion over the definition of 'bool' in rdi-share/host.h
- References: <m3vgdbdchr.fsf@north-pole.nickc.cambridge.redhat.com>
On Tue, Feb 05, 2002 at 06:12:16PM +0000, Nick Clifton wrote:
> 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 ?
(Ew on all counts)
Does not defining bool if it is already defined also work?
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer