re PR preprocessor/7070 (internal error with -Wunknown-pragmas && empty #pragma)
PR preprocessor/7070 * c-lex.c (cb_def_pragma): Don't try to spell CPP_EOF. testsuite: * gcc.dg/Wunknownprag.c: New tests. From-SVN: r55021
This commit is contained in:
parent
0c14a54df6
commit
0647023885
@ -1,3 +1,8 @@
|
||||
2002-06-27 Neil Booth <neil@daikokuya.co.uk>
|
||||
|
||||
PR preprocessor/7070
|
||||
* c-lex.c (cb_def_pragma): Don't try to spell CPP_EOF.
|
||||
|
||||
2002-06-26 Bob Wilson <bob.wilson@acm.org>
|
||||
|
||||
* config/xtensa/xtensa-protos.h (xtensa_return_addr): Declare.
|
||||
|
19
gcc/c-lex.c
19
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-06-27 Neil Booth <neil@daikokuya.co.uk>
|
||||
|
||||
* gcc.dg/Wunknownprag.c: New tests.
|
||||
|
||||
Tue Jun 25 21:50:38 2002 J"orn Rennecke <joern.rennecke@superh.com>
|
||||
|
||||
* gcc.c-torture/execute/simd-2.c: New test.
|
||||
|
11
gcc/testsuite/gcc.dg/Wunknownprag.c
Normal file
11
gcc/testsuite/gcc.dg/Wunknownprag.c
Normal file
@ -0,0 +1,11 @@
|
||||
/* Copyright (C) 2002 Free Software Foundation, Inc. */
|
||||
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-Wunknown-pragmas" } */
|
||||
|
||||
/* We used to get "unspellable token: CPP_EOF" warnings. */
|
||||
|
||||
#pragma /* { dg-warning "ignoring #pragma" } */
|
||||
#pragma ~ /* { dg-warning "ignoring #pragma" } */
|
||||
#pragma baz /* { dg-warning "ignoring #pragma" } */
|
||||
#pragma baz baz /* { dg-warning "ignoring #pragma" } */
|
Loading…
Reference in New Issue
Block a user