diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-27 05:59:53 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-06-27 05:59:53 +0000 |
commit | 5ae4caef64b121ef89043f62438b048d88f7a7e0 (patch) | |
tree | 37d3e37f78afe9a452e98bf96509d76258192dd9 /gcc/c-lex.c | |
parent | 43326cf7509fd6fff93f61d5c59c4198009b655a (diff) | |
download | gcc-5ae4caef64b121ef89043f62438b048d88f7a7e0.tar.gz |
PR preprocessor/7070
* c-lex.c (cb_def_pragma): Don't try to spell CPP_EOF.
testsuite:
* gcc.dg/Wunknownprag.c: New tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55021 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-lex.c')
-rw-r--r-- | gcc/c-lex.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 4cb70c8f886..3d8ecff0885 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -322,20 +322,21 @@ cb_def_pragma (pfile, line) -Wunknown-pragmas has been given. */ if (warn_unknown_pragmas > in_system_header) { - const unsigned char *space, *name = 0; + const unsigned char *space, *name; const cpp_token *s; + space = name = (const unsigned char *) ""; s = cpp_get_token (pfile); - space = cpp_token_as_text (pfile, s); - s = cpp_get_token (pfile); - if (s->type == CPP_NAME) - name = cpp_token_as_text (pfile, s); + if (s->type != CPP_EOF) + { + space = cpp_token_as_text (pfile, s); + s = cpp_get_token (pfile); + if (s->type == CPP_NAME) + name = cpp_token_as_text (pfile, s); + } lineno = SOURCE_LINE (map, line); - if (name) - warning ("ignoring #pragma %s %s", space, name); - else - warning ("ignoring #pragma %s", space); + warning ("ignoring #pragma %s %s", space, name); } } |