aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>2000-02-27 06:24:27 +0000
committerAlexandre Oliva <aoliva@gcc.gnu.org>2000-02-27 06:24:27 +0000
commit0172e2bc87664db2dead8bd8e4157a3343bce72e (patch)
tree51cd086d3197fa1f9e631791825f36792ad11a47 /gcc/cpplib.c
parent22e92ac3b66eb7aa4d43178ec6d629bccc97cd21 (diff)
downloadgcc-0172e2bc87664db2dead8bd8e4157a3343bce72e.zip
gcc-0172e2bc87664db2dead8bd8e4157a3343bce72e.tar.gz
gcc-0172e2bc87664db2dead8bd8e4157a3343bce72e.tar.bz2
* cpplib.c (do_pragma): Accept #pragma without consecutive token.
From-SVN: r32211
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index dff43ca..8c7c2ea 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -1615,14 +1615,21 @@ do_pragma (pfile, keyword)
long here, key;
U_CHAR *buf;
int pop;
+ enum cpp_token token;
here = CPP_WRITTEN (pfile);
CPP_PUTS (pfile, "#pragma ", 8);
key = CPP_WRITTEN (pfile);
pfile->no_macro_expand++;
- if (get_directive_token (pfile) != CPP_NAME)
- goto skip;
+ token = get_directive_token (pfile);
+ if (token != CPP_NAME)
+ {
+ if (token == CPP_VSPACE)
+ goto empty;
+ else
+ goto skip;
+ }
buf = pfile->token_buffer + key;
CPP_PUTC (pfile, ' ');
@@ -1649,6 +1656,7 @@ do_pragma (pfile, keyword)
skip:
cpp_error (pfile, "malformed #pragma directive");
skip_rest_of_line (pfile);
+ empty:
CPP_SET_WRITTEN (pfile, here);
pfile->no_macro_expand--;
return 0;