This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: gdb under solaris7
- To: cagney at redhat dot com
- Subject: Re: gdb under solaris7
- From: Nick Duffek <nsd at redhat dot com>
- Date: Fri, 10 Nov 2000 02:48:38 -0500
- CC: and at genesyslab dot com, cagney at redhat dot com, gdb-patches at sourceware dot cygnus dot com
- References: <3A0B99FF.CB71F51A@cygnus.com>
On 10-Nov-2000, Andrew Cagney wrote:
>> remote.c:
>> >! scan = (char *) ref;
>> [...]
>> >! scan = (unsigned char *) ref;
>>
>> Looks right.
>
>? :-)
I left out the previous two lines of context from remote.c. Here's the
relevant part:
unsigned char *scan;
scan = (char *) ref;
An obvious remote.c error, no?
>> remote.c:
>> >! pkt = unpack_int (pkt, &tag); /* tag */
>> [...]
>> >! pkt = unpack_int (pkt, (int *)&tag); /* tag */
>>
>> How about declaring tag as an int instead? Better not to use typecasts
>> when easily avoidable, I think. Andrew?
>
>TAG should have the correct type for the reference parameter.
My point exactly. TAG is currently declared as unsigned int; unpack_int()
expects a signed int; there's no reason I can see why TAG needs to be
unsigned; ergo, change:
unsigned int tag;
to
int tag;
>Could I suggest going back through and re-thinking any changes that
>involve casts.
There's one other change that involves a cast, and it's as obviously
correct as the "scan" change above:
char *p;
...
p = (unsigned char *) bfd_get_section_name (abfd, sect);
becomes
char *p;
...
p = (char *) bfd_get_section_name (abfd, sect);
Nick