From ed534bdd3753683d7bb4fa1d6b5f1e8760ad7342 Mon Sep 17 00:00:00 2001 From: Gavin Romig-Koch Date: Thu, 1 Jul 1999 08:08:42 +0000 Subject: [PATCH] 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. From-SVN: r27873 --- gcc/ChangeLog | 4 ++++ gcc/c-lex.c | 6 +++--- gcc/cp/ChangeLog | 4 ++++ gcc/cp/lex.c | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c9718864f7d..37b265bdb69 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Thu Jul 1 11:05:25 1999 Gavin Romig-Koch + + * c-lex.c (yylex): Improve 'integer constant out of range' messages. + Wed Jun 30 16:51:41 1999 Nick Clifton * configure.in: Add arm-pe and thumb-pe targets. diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 96ca224bf7c..214bcd1b4e4 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -1775,7 +1775,7 @@ yylex () warn = overflow; if (warn) - 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); /* This is simplified by the fact that our constant is always positive. */ @@ -1866,7 +1866,7 @@ yylex () < TYPE_PRECISION (type))) { warn = 1; - pedwarn ("integer constant out of range"); + pedwarn ("integer constant larger than the maximum value of an unsigned long int"); } if (base == 10 && ! spec_unsigned && TREE_UNSIGNED (type)) @@ -1903,7 +1903,7 @@ yylex () if (! warn && TREE_CODE (TREE_TYPE (yylval.ttype)) == INTEGER_TYPE && ! int_fits_type_p (yylval.ttype, TREE_TYPE (yylval.ttype))) - pedwarn ("integer constant out of range"); + pedwarn ("integer constant is larger than the maximum value for its type"); } UNGETC (c); diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6a3929767b6..c71ffd713e6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +1999-07-01 Gavin Romig-Koch + + * lex.c (real_yylex): Improve 'integer constant out of range' messages. + 1999-06-28 Richard Henderson * decl.c (cp_finish_decl): Fix typo in cp_warning_at call. diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 1ab5df3a304..1e2672627e9 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -3915,7 +3915,7 @@ real_yylex () if (parts[i]) warn = 1; if (warn) - 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); /* This is simplified by the fact that our constant is always positive. */ @@ -3956,7 +3956,7 @@ real_yylex () type = long_long_unsigned_type_node; if (!int_fits_type_p (yylval.ttype, type) && !warn) - pedwarn ("integer constant out of range"); + pedwarn ("integer constant is larger than the maximum value for its type"); if (base == 10 && ! spec_unsigned && TREE_UNSIGNED (type)) warning ("decimal integer constant is so large that it is unsigned"); -- 2.30.2