diff options
| author | Zack Weinberg <zack@wolery.cumb.org> | 2000-01-27 22:29:07 +0000 |
|---|---|---|
| committer | Zack Weinberg <zack@gcc.gnu.org> | 2000-01-27 22:29:07 +0000 |
| commit | 75ec21db305f832534b2072c02a2a785c3cc0b4c (patch) | |
| tree | 8fbdbe32865dcaea5f37fa4f80adc6849f91f96d /gcc/cpplib.h | |
| parent | 73b5cdf98ad368b41766577395b2a5bbd91e3f1b (diff) | |
| download | gcc-75ec21db305f832534b2072c02a2a785c3cc0b4c.zip gcc-75ec21db305f832534b2072c02a2a785c3cc0b4c.tar.gz gcc-75ec21db305f832534b2072c02a2a785c3cc0b4c.tar.bz2 | |
cppinit.c (cpp_handle_option): Recognize C++ comments under -std=gnu89.
* cppinit.c (cpp_handle_option): Recognize C++ comments under
-std=gnu89.
* cpplib.c (skip_block_comment, skip_line_comment): Split code
out of...
(skip_comment) ... here. Permit C++ comments in system
headers always. Warn about C++ comments in user code under
-std=gnu89 -pedantic.
(copy_comment): Use skip_comment.
(cpp_skip_hspace, cpp_get_token): skip_comment can no longer
return EOF.
(consider_directive_while_skipping, do_else, do_endif): Call
validate_else unconditionally.
(validate_else): Check CPP_PEDANTIC here. Accept non-comment
text after the conditional in a system header.
* cpplib.h (struct cpp_buffer): Add flag
warned_cplusplus_comments.
From-SVN: r31654
Diffstat (limited to 'gcc/cpplib.h')
| -rw-r--r-- | gcc/cpplib.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h index 66c77e3..29514a1 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -140,6 +140,11 @@ struct cpp_buffer /* Used by the C++ frontend to implement redirected input (such as for default argument and/or template parsing). */ char manual_pop; + + /* True if we have already warned about C++ comments in this file. + The warning happens only for C89 extended mode with -pedantic on, + and only once per file (otherwise it would be far too noisy). */ + char warned_cplusplus_comments; }; struct file_name_map_list; |
