diff options
author | Zack Weinberg <zack@wolery.cumb.org> | 2000-02-02 21:41:35 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-02-02 21:41:35 +0000 |
commit | 5237f531dafcdf5a118ec501b0bbea1ee4e0928c (patch) | |
tree | 85f4994520bd25edda71f41ae96e75498894cb12 /gcc/cpplib.c | |
parent | 3e7cd49fee867f8af4815815ded1dd621d27ceab (diff) | |
download | gcc-5237f531dafcdf5a118ec501b0bbea1ee4e0928c.zip gcc-5237f531dafcdf5a118ec501b0bbea1ee4e0928c.tar.gz gcc-5237f531dafcdf5a118ec501b0bbea1ee4e0928c.tar.bz2 |
cpplib.h (cpp_reader): Add new flag, no_directives.
* cpplib.h (cpp_reader): Add new flag, no_directives.
* cpphash.c (macarg): Set it.
* cpplib.c (handle_directive): If no_directives is on and we
find a directive, issue an error and discard the line.
From-SVN: r31763
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index cdfdaa3..5375d2b 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -568,7 +568,15 @@ handle_directive (pfile) } CPP_SET_WRITTEN (pfile, old_written); - (*kt->func) (pfile, kt); + + if (pfile->no_directives) + { + cpp_error (pfile, "`#%s' may not be used inside a macro argument", + kt->name); + skip_rest_of_line (pfile); + } + else + (*kt->func) (pfile, kt); return 1; } |