From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Buettner To: Jeff Holcomb , Kevin Buettner Cc: gdb-patches@sourceware.cygnus.com Subject: Re: [RFA] fix gdb.base/remote.c and h8300 Date: Tue, 28 Aug 2001 16:28:00 -0000 Message-id: <1010828232808.ZM17691@ocotillo.lan> References: X-SW-Source: 2001-08/msg00289.html On Aug 28, 4:16pm, Jeff Holcomb wrote: > > On Aug 28, 11:12am, Jeff Holcomb wrote: > > > > > +#ifdef __H8300__ > > > +# define RANDOM_DATA_SIZE (1024) > > > +#endif > > > + > > > > We need to think of a better way to do this. I've run into a similar > > problem on a target that I've worked on in the past too. I don't think > > that adding ifdefs for all the targets that need a smaller size is the > > way to go... > > Yes. I agree there needs to be a better way. The problem I have is that > the H8300s has 16-bit int and 16-bit pointers. There's no way the large > structure defined in remote.c can fit so gcc spews a bunch of errors when > compiling. There existed a mechanism already in remote.c to handle this, > so I just extended it to the h8300. > > Whatever the solution, it has to be done in the preprocessor. Perhaps > checking to see how big MAXINT is defined to be? Yeah. Or maybe just check sizeof (int)? #if sizeof (int) <= 2 # define RANDOM_DATA_SIZE (1024) #else ... #endif (That way we're not depending on any header files for this test.)