* Confusion over the definition of 'bool' in rdi-share/host.h
@ 2002-02-05 10:11 Nick Clifton
2002-02-05 10:59 ` Daniel Jacobowitz
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Nick Clifton @ 2002-02-05 10:11 UTC (permalink / raw)
To: gdb-patches
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 <nickc@cambridge.redhat.com>
* 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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-05 10:11 Confusion over the definition of 'bool' in rdi-share/host.h Nick Clifton
@ 2002-02-05 10:59 ` Daniel Jacobowitz
2002-02-05 11:38 ` Stan Shebs
2002-02-06 2:57 ` Richard Earnshaw
2 siblings, 0 replies; 10+ messages in thread
From: Daniel Jacobowitz @ 2002-02-05 10:59 UTC (permalink / raw)
To: Nick Clifton; +Cc: gdb-patches
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-05 10:11 Confusion over the definition of 'bool' in rdi-share/host.h Nick Clifton
2002-02-05 10:59 ` Daniel Jacobowitz
@ 2002-02-05 11:38 ` Stan Shebs
2002-02-05 19:29 ` Andrew Cagney
2002-02-06 2:57 ` Richard Earnshaw
2 siblings, 1 reply; 10+ messages in thread
From: Stan Shebs @ 2002-02-05 11:38 UTC (permalink / raw)
To: Nick Clifton; +Cc: gdb-patches
Nick Clifton wrote:
>
> 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 ?
We do whatever we want to rdi-share/*. My personal vote is to
delete it and start over... :-)
Stan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-05 11:38 ` Stan Shebs
@ 2002-02-05 19:29 ` Andrew Cagney
2002-02-06 13:02 ` Grant Edwards
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cagney @ 2002-02-05 19:29 UTC (permalink / raw)
To: Stan Shebs; +Cc: Nick Clifton, gdb-patches
> Nick Clifton wrote:
>
>>
>> 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 ?
>
>
> We do whatever we want to rdi-share/*. My personal vote is to
> delete it and start over... :-)
Next release? :-) Have you seen how much protocol/remote stuff deleting
the a29k eliminates?
Andrew
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-05 10:11 Confusion over the definition of 'bool' in rdi-share/host.h Nick Clifton
2002-02-05 10:59 ` Daniel Jacobowitz
2002-02-05 11:38 ` Stan Shebs
@ 2002-02-06 2:57 ` Richard Earnshaw
2002-02-06 6:13 ` Fernando Nasser
2 siblings, 1 reply; 10+ messages in thread
From: Richard Earnshaw @ 2002-02-06 2:57 UTC (permalink / raw)
To: Nick Clifton; +Cc: gdb-patches, Richard.Earnshaw
> 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
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.
R.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-06 2:57 ` Richard Earnshaw
@ 2002-02-06 6:13 ` Fernando Nasser
2002-02-06 13:06 ` Grant Edwards
0 siblings, 1 reply; 10+ messages in thread
From: Fernando Nasser @ 2002-02-06 6:13 UTC (permalink / raw)
To: Richard.Earnshaw; +Cc: Nick Clifton, gdb-patches
Richard Earnshaw 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 ?
> >
> > Cheers
> > Nick
>
> 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.
>
> R.
Yes.
But until someone finds the time to do that I guess we must apply
Nick's patch.
Regards to all,
Fernando
--
Fernando Nasser
Red Hat Canada Ltd. E-Mail: fnasser@redhat.com
2323 Yonge Street, Suite #300
Toronto, Ontario M4P 2C9
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-05 19:29 ` Andrew Cagney
@ 2002-02-06 13:02 ` Grant Edwards
2002-02-06 21:36 ` Stan Shebs
0 siblings, 1 reply; 10+ messages in thread
From: Grant Edwards @ 2002-02-06 13:02 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Stan Shebs, Nick Clifton, gdb-patches
On Tue, Feb 05, 2002 at 10:29:00PM -0500, Andrew Cagney wrote:
> > Nick Clifton wrote:
> >
> >>
> >> 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 ?
> >
> >
> > We do whatever we want to rdi-share/*. My personal vote is to
> > delete it and start over... :-)
>
> Next release? :-) Have you seen how much protocol/remote stuff
> deleting the a29k eliminates?
OK, I see the smileys, but this would be a major problem for
me, so forgive my paranoia:
Are you seriously proposing that somebody re-write ADP protocol
support from scratch or that support for ADP be abandoned
completely?
Somebody at EPI is working on supporting the "remote" protocol
with newer JTAG interfaces, but until that happens (and
somebody gives me about $10K to replace my development
hardware), I need ADP support.
--
Grant Edwards
grante@visi.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-06 6:13 ` Fernando Nasser
@ 2002-02-06 13:06 ` Grant Edwards
0 siblings, 0 replies; 10+ messages in thread
From: Grant Edwards @ 2002-02-06 13:06 UTC (permalink / raw)
To: Fernando Nasser; +Cc: Richard.Earnshaw, Nick Clifton, gdb-patches
On Wed, Feb 06, 2002 at 09:12:28AM -0500, Fernando Nasser wrote:
> > 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.
> But until someone finds the time to do that I guess we must
> apply Nick's patch.
I could probably make some time to work on this if somebody
wanted to tell me exactly what set of sources I should start
with. Keeping support for ADP is pretty important to one of
the products I work on.
--
Grant Edwards
grante@visi.com
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-06 13:02 ` Grant Edwards
@ 2002-02-06 21:36 ` Stan Shebs
2002-02-14 8:09 ` Grant Edwards
0 siblings, 1 reply; 10+ messages in thread
From: Stan Shebs @ 2002-02-06 21:36 UTC (permalink / raw)
To: Grant Edwards; +Cc: Andrew Cagney, Nick Clifton, gdb-patches
Grant Edwards wrote:
>
> Are you seriously proposing that somebody re-write ADP protocol
> support from scratch or that support for ADP be abandoned
> completely?
Speaking seriously, ADP is still in use even if it is a lame
protocol, so no it's not going to get dropped. The RDI code is
however a completely steamy pile, and if I had to do it all over
again, I would rather have spent three weeks of 16-hour days
implementing the protocol from scratch, rather than taking
the same amount of time stretched out over months trying to
get it to work right on every host.
The ADP protocol is more complicated than the standard
remote protocol, and if you stick to what actually works rather
than what ARM fantasized about but never implemented, it's
not really that hairy. Another case where I chickened out
rather than doing the Right Thing.
Stan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Confusion over the definition of 'bool' in rdi-share/host.h
2002-02-06 21:36 ` Stan Shebs
@ 2002-02-14 8:09 ` Grant Edwards
0 siblings, 0 replies; 10+ messages in thread
From: Grant Edwards @ 2002-02-14 8:09 UTC (permalink / raw)
To: Stan Shebs; +Cc: Andrew Cagney, Nick Clifton, gdb-patches
On Wed, Feb 06, 2002 at 09:36:02PM -0800, Stan Shebs wrote:
>
> Speaking seriously, ADP is still in use even if it is a lame
> protocol, so no it's not going to get dropped. The RDI code is
> however a completely steamy pile, and if I had to do it all over
> again, I would rather have spent three weeks of 16-hour days
> implementing the protocol from scratch, rather than taking
> the same amount of time stretched out over months trying to
> get it to work right on every host.
Yup. I've spent god-knows how many hours fussing with the code
that parses device names because it keeps refusing to recognize
serial ports on my machine. Apparently that bit of code was
some sort of failed AI experiment. You'd think that if I claim
I've got a serial port called /dev/ttySI15, then it would just
go ahead and open it! But noooo, the RDI code thinks it has a
priori knowledge about what serial ports I have and what they
are called.
> The ADP protocol is more complicated than the standard remote
> protocol,
That's the understatement of the week! :)
ADP has more unused features than anything I've seen in a
_long_ time. It looks more like a PhD project than something
somebody actually expected to work with.
> and if you stick to what actually works rather than what ARM
> fantasized about but never implemented, it's not really that
> hairy. Another case where I chickened out rather than doing
> the Right Thing.
It happens to all of us...
--
Grant Edwards
grante@visi.com
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2002-02-14 16:09 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-05 10:11 Confusion over the definition of 'bool' in rdi-share/host.h Nick Clifton
2002-02-05 10:59 ` Daniel Jacobowitz
2002-02-05 11:38 ` Stan Shebs
2002-02-05 19:29 ` Andrew Cagney
2002-02-06 13:02 ` Grant Edwards
2002-02-06 21:36 ` Stan Shebs
2002-02-14 8:09 ` Grant Edwards
2002-02-06 2:57 ` Richard Earnshaw
2002-02-06 6:13 ` Fernando Nasser
2002-02-06 13:06 ` Grant Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox