summaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-30 22:29:00 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2000-10-30 22:29:00 +0000
commit396ffa866b4e8c2ac1d3b2ec6f1f687cfdd4568b (patch)
treeaea40a1085df8546a232c08b4db9f87353674441 /gcc/cpplib.h
parent20b8559294988448711df71d29e657bd12e3ea8f (diff)
downloadgcc-396ffa866b4e8c2ac1d3b2ec6f1f687cfdd4568b.tar.gz
* cppfiles.c (stack_include_file): Check for stacked contexts
here. * cpphash.h (_cpp_do__Pragma): New prototype. * cppinit.c (cpp_reader_init): Add _Pragma keyword to hash table. * cpplex.c (skip_escaped_newlines): Only process trigraphs and escaped newlines if !(buffer->from_stage3). (_cpp_lex_token): Warn about missing newlines iff !buffer->from_stage3. * cpplib.c (get__Pragma_string, destringize, _cpp_do__Pragma): New functions. (run_directive): Set output_line for _Pragma to avoid line markers in output. Set from_stage3 and prevent macro expansion for _Pragma and command-line options. Check buffer exhaustion. (cpp_push_buffer): Don't check for stacked macro contexts, as this is perfectly legitimate for _Pragma. Move the check to stack_include_file instead. Set from_stage3 iff buffer is preprocessed input. * cpplib.h (struct cpp_buffer): Make warned_cplusplus_comments unsigned. New boolean from_stage3. (struct spec_nodes): Add n__Pragma. * cppmacro.c (enter_macro_context): Flip sense of return value. (_cpp_get_token): Handle _Pragma operator. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37147 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 747ff18bad1..de7a1a54caa 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -287,7 +287,12 @@ struct cpp_buffer
The warning happens only for C89 extended mode with -pedantic on,
or for -Wtraditional, and only once per file (otherwise it would
be far too noisy). */
- char warned_cplusplus_comments;
+ unsigned char warned_cplusplus_comments;
+
+ /* True if we don't process trigraphs and escaped newlines. True
+ for preprocessed input, command line directives, and _Pragma
+ buffers. */
+ unsigned char from_stage3;
};
/* Maximum nesting of cpp_buffers. We use a static limit, partly for
@@ -509,6 +514,7 @@ struct spec_nodes
{
cpp_hashnode *n_L; /* L"str" */
cpp_hashnode *n_defined; /* defined operator */
+ cpp_hashnode *n__Pragma; /* _Pragma operator */
cpp_hashnode *n__STRICT_ANSI__; /* STDC_0_IN_SYSTEM_HEADERS */
cpp_hashnode *n__CHAR_UNSIGNED__; /* plain char is unsigned */
cpp_hashnode *n__VA_ARGS__; /* C99 vararg macros */