This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
cpplib: Fix LL diagnostics
- To: gcc-patches at gcc dot gnu dot org
- Subject: cpplib: Fix LL diagnostics
- From: Neil Booth <neilb at earthling dot net>
- Date: Sat, 2 Dec 2000 10:11:37 +0000
As reported by Joseph.
Neil.
* cppexp.c (parse_number): Update diagnostic test.
* gcc.dg/testsuite/c++98.c,c++98-pedantic.c,c89.c,c89-pedantic.c,
c94.c,c94-pedantic.c,c99.c,c99-pedantic.c,gnuc89.c,gnuc89-pedantic.c,
gnuc99.c,gnuc99-pedantic.c: New tests.
Index: cppexp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cppexp.c,v
retrieving revision 1.81
diff -u -p -r1.81 cppexp.c
--- cppexp.c 2000/11/26 17:31:09 1.81
+++ cppexp.c 2000/12/02 10:05:12
@@ -205,8 +205,9 @@ parse_number (pfile, tok)
if (CPP_WTRADITIONAL (pfile) && sufftab[i].u)
cpp_warning (pfile, "traditional C rejects the `U' suffix");
- if (sufftab[i].l == 2 && !CPP_OPTION (pfile, extended_numbers))
- SYNTAX_ERROR ("too many 'l' suffixes in integer constant");
+ if (sufftab[i].l == 2 && CPP_OPTION (pfile, pedantic)
+ && ! CPP_OPTION (pfile, c99))
+ cpp_pedwarn (pfile, "too many 'l' suffixes in integer constant");
}
if (base <= largest_digit)
Index: testsuite/gcc.dg/cpp/c++98-pedantic.c
===================================================================
RCS file: c++98-pedantic.c
diff -N c++98-pedantic.c
--- /dev/null Tue May 5 13:32:27 1998
+++ c++98-pedantic.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=c++98 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "too many" } */
+#endif
Index: testsuite/gcc.dg/cpp/c++98.c
===================================================================
RCS file: c++98.c
diff -N c++98.c
--- /dev/null Tue May 5 13:32:27 1998
+++ c++98.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98" } */
+
+/* This file is for testing the preprocessor in -std=c++98 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
Index: testsuite/gcc.dg/cpp/c89-pedantic.c
===================================================================
RCS file: c89-pedantic.c
diff -N c89-pedantic.c
--- /dev/null Tue May 5 13:32:27 1998
+++ c89-pedantic.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c89 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=c89 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "too many" } */
+#endif
Index: testsuite/gcc.dg/cpp/c89.c
===================================================================
RCS file: c89.c
diff -N c89.c
--- /dev/null Tue May 5 13:32:27 1998
+++ c89.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c89" } */
+
+/* This file is for testing the preprocessor in -std=c89 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
Index: testsuite/gcc.dg/cpp/c94-pedantic.c
===================================================================
RCS file: c94-pedantic.c
diff -N c94-pedantic.c
--- /dev/null Tue May 5 13:32:27 1998
+++ c94-pedantic.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:199409 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=iso9899:199409
+ -pedantic mode. Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "too many" } */
+#endif
Index: testsuite/gcc.dg/cpp/c94.c
===================================================================
RCS file: c94.c
diff -N c94.c
--- /dev/null Tue May 5 13:32:27 1998
+++ c94.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:199409" } */
+
+/* This file is for testing the preprocessor in -std=iso9899:199409 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
Index: testsuite/gcc.dg/cpp/c99-pedantic.c
===================================================================
RCS file: c99-pedantic.c
diff -N c99-pedantic.c
--- /dev/null Tue May 5 13:32:27 1998
+++ c99-pedantic.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=c99 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
Index: testsuite/gcc.dg/cpp/c99.c
===================================================================
RCS file: c99.c
diff -N c99.c
--- /dev/null Tue May 5 13:32:27 1998
+++ c99.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c99" } */
+
+/* This file is for testing the preprocessor in -std=c99 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
Index: testsuite/gcc.dg/cpp/gnuc89-pedantic.c
===================================================================
RCS file: gnuc89-pedantic.c
diff -N gnuc89-pedantic.c
--- /dev/null Tue May 5 13:32:27 1998
+++ gnuc89-pedantic.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu89 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=gnu89 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "too many" } */
+#endif
Index: testsuite/gcc.dg/cpp/gnuc89.c
===================================================================
RCS file: gnuc89.c
diff -N gnuc89.c
--- /dev/null Tue May 5 13:32:27 1998
+++ gnuc89.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu89" } */
+
+/* This file is for testing the preprocessor in -std=gnu89 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
Index: testsuite/gcc.dg/cpp/gnuc99-pedantic.c
===================================================================
RCS file: gnuc99-pedantic.c
diff -N gnuc99-pedantic.c
--- /dev/null Tue May 5 13:32:27 1998
+++ gnuc99-pedantic.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=gnu99 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
Index: testsuite/gcc.dg/cpp/gnuc99.c
===================================================================
RCS file: gnuc99.c
diff -N gnuc99.c
--- /dev/null Tue May 5 13:32:27 1998
+++ gnuc99.c Sat Dec 2 02:05:22 2000
@@ -0,0 +1,10 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=gnu99" } */
+
+/* This file is for testing the preprocessor in -std=gnu99 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif