This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFA] fix gdb.base/remote.c for small int targets
- To: jeffh at redhat dot com
- Subject: Re: [RFA] fix gdb.base/remote.c for small int targets
- From: "Eli Zaretskii" <eliz at is dot elta dot co dot il>
- Date: Fri, 31 Aug 2001 10:25:57 +0300
- CC: gdb-patches at sourceware dot cygnus dot com
- References: <Pine.SOL.3.91.1010830220552.25088t-100000@taarna.cygnus.com>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
> Date: Thu, 30 Aug 2001 22:11:23 -0700 (PDT)
> From: Jeff Holcomb <jeffh@redhat.com>
>
> -#ifdef mc68hc11
> +#include <limits.h>
> +/* For targets with 16bit int, use a 1k buffer. */
> +#if INT_MAX < 32768
Shouldn't you use 32768L or 32768U? If an int is only 16 bits wide,
32768 might overflow into the sign bit, and then all bets are off.