very wide integer literals

Gavin Romig-Koch gavin@cygnus.com
Wed Feb 17 11:37:00 GMT 1999


If no one sees a problem with this, or otherwise objects, I'll commit this
in the next few days.

                                              -gavin...


	* c-lex.c (yylex): Replace warning about integer constants being
	larger than long-longs, with a warning about integer constants 
        being larger than the largest target integer.

Index: gcc/c-lex.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-lex.c,v
retrieving revision 1.43
diff -p -c -r1.43 c-lex.c
*** gcc/c-lex.c	1999/01/27 01:41:46	1.43
--- gcc/c-lex.c	1999/02/17 19:00:36
*************** yylex ()
*** 1708,1722 ****
  		c = GETC();
  	      }
  
! 	    /* If the constant won't fit in an unsigned long long,
! 	       then warn that the constant is out of range.  */
  
! 	    /* ??? This assumes that long long and long integer types are
! 	       a multiple of 8 bits.  This better than the original code
! 	       though which assumed that long was exactly 32 bits and long
! 	       long was exactly 64 bits.  */
! 
! 	    bytes = TYPE_PRECISION (long_long_integer_type_node) / 8;
  
  	    warn = overflow;
  	    for (i = bytes; i < TOTAL_PARTS; i++)
--- 1708,1722 ----
  		c = GETC();
  	      }
  
! 	    /* If the constant won't fit in the targets widest int,
! 	       or it won't fit in the host's representation for ints, 
! 	       then warn that the constant is out of range. */
  
! #if HOST_BITS_PER_WIDE_INT >= 64
! 	    bytes = TYPE_PRECISION (intTI_type_node) / HOST_BITS_PER_CHAR;
! #else
! 	    bytes = TYPE_PRECISION (intDI_type_node) / HOST_BITS_PER_CHAR;
! #endif
  
  	    warn = overflow;
  	    for (i = bytes; i < TOTAL_PARTS; i++)


More information about the Gcc-patches mailing list