diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-31 07:56:07 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-01-31 07:56:07 +0000 |
commit | 81ada207aef969fc7069c199d80f581e6165285f (patch) | |
tree | 161db8322774ceb1d9bb51392b88a49908492157 /gcc/cpplib.c | |
parent | 33d1e63a77e6a2d69ea5b1d0dab5eabcd0bf608c (diff) | |
download | gcc-81ada207aef969fc7069c199d80f581e6165285f.tar.gz |
* cpplib.c (T_ELIF): Move to STDC89, not that it matters.
(_cpp_handle_directive): Suggest not using #elif with -Wtraditional.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@39368 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 5c422f563c8..da6e39758b0 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -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); |