cpplib.c (do_ifdef): Add check_eol() call.
authorGeoffrey Keating <geoffk@redhat.com>
Sat, 2 Dec 2000 22:28:44 +0000 (22:28 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sat, 2 Dec 2000 22:28:44 +0000 (22:28 +0000)
* cpplib.c (do_ifdef): Add check_eol() call.
(do_ifndef): Likewise.

* gcc.dg/20001201-1.c: New testcase.

From-SVN: r37960

gcc/ChangeLog
gcc/cpplib.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20001201-1.c [new file with mode: 0644]

index 97fd77a..6a08a83 100644 (file)
@@ -1,3 +1,8 @@
+2000-12-01  Geoffrey Keating  <geoffk@redhat.com>
+
+       * cpplib.c (do_ifdef): Add check_eol() call.
+       (do_ifndef): Likewise.
+
 2000-12-02  Daniel Berlin  <dberlin@redhat.com>
             Bruce Korb  <bkorb@gnu.org>
 
index 2eaf755..d4b243f 100644 (file)
@@ -1221,6 +1221,9 @@ do_ifdef (pfile)
 
       if (node)
        skip = node->type != NT_MACRO;
+
+      if (node)
+       check_eol (pfile);
     }
 
   push_conditional (pfile, skip, T_IFDEF, 0);
@@ -1238,6 +1241,9 @@ do_ifndef (pfile)
       node = lex_macro_node (pfile);
       if (node)
        skip = node->type == NT_MACRO;
+
+      if (node)
+       check_eol (pfile);
     }
 
   push_conditional (pfile, skip, T_IFNDEF, node);
index 0b5b35b..367f5d8 100644 (file)
@@ -1,3 +1,7 @@
+2000-12-01  Geoffrey Keating  <geoffk@redhat.com>
+
+       * gcc.dg/20001201-1.c: New testcase.
+       
 2000-12-02  Neil Booth  <neilb@earthling.net>
 
         * g++.old-deja/g++.other/externC4.C,
diff --git a/gcc/testsuite/gcc.dg/20001201-1.c b/gcc/testsuite/gcc.dg/20001201-1.c
new file mode 100644 (file)
index 0000000..195801a
--- /dev/null
@@ -0,0 +1,7 @@
+/* { dg-do compile } */
+/* { dg-options "-pedantic" } */
+char *s =
+"0123456789101214161820222426283032343638404244464850525456586062646668707274767880828486889092949698100103106109112115118121124127130133136139142145148151154157160163166169172175178181184187190193196199202205208211214217220223226229232235238241244247250253256259262265268271274277280283286289292295298301304307310313316319322325328331334337340343346349352355358361364367370373376379382385388391394397400403406409412415418421424427430433436439442445448451454457460463466469472475478481484487490493496499502"
+"505x";  /* { dg-bogus "greater than the minimum length" } */
+
+