C and C++ PATCH: Improve 'integer constant out of range' messages.

Gavin Romig-Koch gavin@cygnus.com
Thu Jul 1 06:04:00 GMT 1999


OK for mainline?

                                       -gavin...


This patch replaces the several 'integer constant out of range' messages
in gcc and g++ with more specific messages.


For gcc:
	* c-lex.c (yylex): Improve 'integer constant out of range' messages.

For gcc/cp:
	* lex.c (real_yylex): Improve 'integer constant out of range' messages.


Index: c-lex.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/c-lex.c,v
retrieving revision 1.50
diff -r1.50 c-lex.c
1778c1778
< 	      pedwarn ("integer constant out of range");
---
> 	      pedwarn ("integer constant is too large for this configuration of the compiler - truncated to %d bits", HOST_BITS_PER_WIDE_INT * 2);
1869c1869
< 		pedwarn ("integer constant out of range");
---
> 		pedwarn ("integer constant larger than the maximum value of an unsigned long int");
1906c1906
< 	      pedwarn ("integer constant out of range");
---
> 	      pedwarn ("integer constant is larger than the maximum value for its type");
Index: cp/lex.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/lex.c,v
retrieving revision 1.114
diff -r1.114 lex.c
3918c3918
< 	      pedwarn ("integer constant out of range");
---
> 	      pedwarn ("integer constant is too large for this configuration of the compiler - truncated to %d bits", HOST_BITS_PER_WIDE_INT * 2);
3959c3959
< 	      pedwarn ("integer constant out of range");
---
> 	      pedwarn ("integer constant is larger than the maximum value for its type");


More information about the Gcc-patches mailing list