aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGavin Romig-Koch <gavin@cygnus.com>1999-02-22 08:18:56 +0000
committerGavin Romig-Koch <gavin@gcc.gnu.org>1999-02-22 08:18:56 +0000
commite2e0986eb009914748986c469a89aae521805bfb (patch)
tree100a85bbee6a92b3b340227d4689216288e82779
parente9c0315e10f7778d51504be20dcb525dec080d44 (diff)
downloadgcc-e2e0986eb009914748986c469a89aae521805bfb.zip
gcc-e2e0986eb009914748986c469a89aae521805bfb.tar.gz
gcc-e2e0986eb009914748986c469a89aae521805bfb.tar.bz2
c-lex.c (yylex): Replace warning about integer constants being larger than long-longs...
* 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. From-SVN: r25364
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/c-lex.c16
2 files changed, 14 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 65bec6f..7598168 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Mon Feb 22 10:55:00 1999 Gavin Romig-Koch <gavin@cygnus.com>
+
+ * 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.
+
Fri Feb 19 18:18:56 1999 Don Bowman <don@pixstream.com>
* configure.in (mips*-*-vxworks*): Enable gthreads vxworks support.
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index e054607..8f63b2d 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -1698,15 +1698,15 @@ yylex ()
c = GETC();
}
- /* If the constant won't fit in an unsigned long long,
- then warn that the constant is out of range. */
+ /* 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. */
- /* ??? 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;
+#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++)