This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: zap warnings from sparc.c
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch: zap warnings from sparc.c
- From: Richard Henderson <rth at redhat dot com>
- Date: Wed, 15 Aug 2001 15:31:32 -0700
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200108151550.LAA20041@caip.rutgers.edu>
On Wed, Aug 15, 2001 at 11:50:10AM -0400, Kaveh R. Ghazi wrote:
> > sparc.c:1139: warning: integer constant larger than the maximum
> > value of an unsigned long int
[...]
> - && INTVAL (op) < 0x100000000)));
> + && INTVAL (op) < 0x100000000LL)));
Not ok. One should be able to build on a 64-bit host that
does not support long long. Use <= 0xffffffff.
> - fprintf (file, "\tadd\t%s, %d, %s\n",
> - sp_str, -size, sp_str);
> + fprintf (file, "\tadd\t%s, ", sp_str);
> + fprintf (file, HOST_WIDE_INT_PRINT_DEC, -size);
> + fprintf (file, ", %s\n", sp_str);
Or cast to (int), since we've just checked that 0 < size <= 4096,
which I think is more readable. Likewise with the rest of these.
r~