This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch: zap warnings from sparc.c


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]