cpplib.c (T_ELIF): Move to STDC89, not that it matters.
authorNeil Booth <neil@daikokuya.demon.co.uk>
Wed, 31 Jan 2001 07:56:07 +0000 (07:56 +0000)
committerNeil Booth <neil@gcc.gnu.org>
Wed, 31 Jan 2001 07:56:07 +0000 (07:56 +0000)
        * cpplib.c (T_ELIF): Move to STDC89, not that it matters.
        (_cpp_handle_directive): Suggest not using #elif with -Wtraditional.

From-SVN: r39368

gcc/ChangeLog
gcc/cpplib.c

index e4016f1313823c63737fb8fdb07fc7f68f6aae7b..f7ad2b0476d9d62fb2fe73a226375dc017d8ed92 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-31  Neil Booth  <neil@daikokuya.demon.co.uk>
+
+        * cpplib.c (T_ELIF): Move to STDC89, not that it matters.
+        (_cpp_handle_directive): Suggest not using #elif with -Wtraditional.
+
 2001-01-31  Neil Booth  <neil@daikokuya.demon.co.uk>
 
         * cpphash.h (struct cpp_reader): New saved_flags.
index 5c422f563c82666b8c3d2b4154c7ef94ac369832..da6e39758b0b0eb2da18e710624f9c38af5579e6 100644 (file)
@@ -128,7 +128,7 @@ D(else,             T_ELSE,         KANDR,     COND)           /*   9863 */ \
 D(ifndef,      T_IFNDEF,       KANDR,     COND | IF_COND) /*   9675 */ \
 D(undef,       T_UNDEF,        KANDR,     IN_I)           /*   4837 */ \
 D(line,                T_LINE,         KANDR,     IN_I)           /*   2465 */ \
-D(elif,                T_ELIF,         KANDR,     COND)           /*    610 */ \
+D(elif,                T_ELIF,         STDC89,    COND)           /*    610 */ \
 D(error,       T_ERROR,        STDC89,    0)              /*    475 */ \
 D(pragma,      T_PRAGMA,       STDC89,    IN_I)           /*    195 */ \
 D(warning,     T_WARNING,      EXTENSION, 0)              /*     22 */ \
@@ -321,7 +321,10 @@ _cpp_handle_directive (pfile, indented)
             conditional blocks.  */
          if (CPP_WTRADITIONAL (pfile))
            {
-             if (indented && dir->origin == KANDR)
+             if (dir == &dtable[T_ELIF])
+               cpp_warning (pfile,
+                            "suggest not using #elif in traditional C");
+             else if (indented && dir->origin == KANDR)
                cpp_warning (pfile,
                             "traditional C ignores #%s with the # indented",
                             dir->name);