2 Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
4 Contributed by Per Bothner, 1994-95.
5 Based on CCCP program by Paul Rubin, June 1986
6 Adapted to ANSI C, Richard Stallman, Jan 1987
8 This program is free software; you can redistribute it and/or modify it
9 under the terms of the GNU General Public License as published by the
10 Free Software Foundation; either version 2, or (at your option) any
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
24 #include "coretypes.h"
31 /* Internal structures and prototypes. */
33 /* A `struct pending_option' remembers one -D, -A, -U, -include, or
35 typedef void (* cl_directive_handler) PARAMS ((cpp_reader *, const char *));
38 struct pending_option *next;
40 cl_directive_handler handler;
43 /* The `pending' structure accumulates all the options that are not
44 actually processed until we hit cpp_read_main_file. It consists of
45 several lists, one for each type of option. We keep both head and
46 tail pointers for quick insertion. */
49 struct pending_option *directive_head, *directive_tail;
50 struct pending_option *imacros_head, *imacros_tail;
54 #define APPEND(pend, list, elt) \
55 do { if (!(pend)->list##_head) (pend)->list##_head = (elt); \
56 else (pend)->list##_tail->next = (elt); \
57 (pend)->list##_tail = (elt); \
60 #define APPEND(pend, list, elt) \
61 do { if (!(pend)->list/**/_head) (pend)->list/**/_head = (elt); \
62 else (pend)->list/**/_tail->next = (elt); \
63 (pend)->list/**/_tail = (elt); \
67 static void init_library PARAMS ((void));
68 static void init_builtins PARAMS ((cpp_reader *));
69 static void mark_named_operators PARAMS ((cpp_reader *));
70 static void free_chain PARAMS ((struct pending_option *));
71 static void read_original_filename PARAMS ((cpp_reader *));
72 static void new_pending_directive PARAMS ((struct cpp_pending *,
74 cl_directive_handler));
75 static int parse_option PARAMS ((const char *));
76 static void post_options PARAMS ((cpp_reader *));
78 /* If we have designated initializers (GCC >2.7) these tables can be
79 initialized, constant data. Otherwise, they have to be filled in at
81 #if HAVE_DESIGNATED_INITIALIZERS
83 #define init_trigraph_map() /* Nothing. */
84 #define TRIGRAPH_MAP \
85 __extension__ const uchar _cpp_trigraph_map[UCHAR_MAX + 1] = {
88 #define s(p, v) [p] = v,
92 #define TRIGRAPH_MAP uchar _cpp_trigraph_map[UCHAR_MAX + 1] = { 0 }; \
93 static void init_trigraph_map PARAMS ((void)) { \
94 unsigned char *x = _cpp_trigraph_map;
97 #define s(p, v) x[p] = v;
102 s('=', '#') s(')', ']') s('!', '|')
103 s('(', '[') s('\'', '^') s('>', '}')
104 s('/', '\\') s('<', '{') s('-', '~')
111 /* A set of booleans indicating what CPP features each source language
117 char extended_numbers;
119 char dollars_in_ident;
120 char cplusplus_comments;
124 /* ??? Enable $ in identifiers in assembly? */
125 static const struct lang_flags lang_defaults[] =
126 { /* c99 c++ xnum std dollar c++comm digr */
127 /* GNUC89 */ { 0, 0, 1, 0, 1, 1, 1 },
128 /* GNUC99 */ { 1, 0, 1, 0, 1, 1, 1 },
129 /* STDC89 */ { 0, 0, 0, 1, 0, 0, 0 },
130 /* STDC94 */ { 0, 0, 0, 1, 0, 0, 1 },
131 /* STDC99 */ { 1, 0, 1, 1, 0, 1, 1 },
132 /* GNUCXX */ { 0, 1, 1, 0, 1, 1, 1 },
133 /* CXX98 */ { 0, 1, 1, 1, 0, 1, 1 },
134 /* ASM */ { 0, 0, 1, 0, 0, 1, 0 }
137 /* Sets internal flags correctly for a given language. */
139 cpp_set_lang (pfile, lang)
143 const struct lang_flags *l = &lang_defaults[(int) lang];
145 CPP_OPTION (pfile, lang) = lang;
147 CPP_OPTION (pfile, c99) = l->c99;
148 CPP_OPTION (pfile, cplusplus) = l->cplusplus;
149 CPP_OPTION (pfile, extended_numbers) = l->extended_numbers;
150 CPP_OPTION (pfile, std) = l->std;
151 CPP_OPTION (pfile, trigraphs) = l->std;
152 CPP_OPTION (pfile, dollars_in_ident) = l->dollars_in_ident;
153 CPP_OPTION (pfile, cplusplus_comments) = l->cplusplus_comments;
154 CPP_OPTION (pfile, digraphs) = l->digraphs;
158 static int opt_comp PARAMS ((const void *, const void *));
160 /* Run-time sorting of options array. */
165 return strcmp (((struct cl_option *) p1)->opt_text,
166 ((struct cl_option *) p2)->opt_text);
170 /* init initializes library global state. It might not need to
171 do anything depending on the platform and compiler. */
175 static int initialized = 0;
182 /* For non-ASCII hosts, the cl_options array needs to be sorted at
184 qsort (cl_options, N_OPTS, sizeof (struct cl_option), opt_comp);
187 /* Set up the trigraph map. This doesn't need to do anything if
188 we were compiled with a compiler that supports C99 designated
190 init_trigraph_map ();
196 /* Initialize a cpp_reader structure. */
198 cpp_create_reader (lang)
203 /* Initialize this instance of the library if it hasn't been already. */
206 pfile = (cpp_reader *) xcalloc (1, sizeof (cpp_reader));
208 cpp_set_lang (pfile, lang);
209 CPP_OPTION (pfile, warn_import) = 1;
210 CPP_OPTION (pfile, warn_multichar) = 1;
211 CPP_OPTION (pfile, discard_comments) = 1;
212 CPP_OPTION (pfile, discard_comments_in_macro_exp) = 1;
213 CPP_OPTION (pfile, show_column) = 1;
214 CPP_OPTION (pfile, tabstop) = 8;
215 CPP_OPTION (pfile, operator_names) = 1;
216 CPP_OPTION (pfile, warn_endif_labels) = 1;
217 CPP_OPTION (pfile, warn_deprecated) = 1;
218 CPP_OPTION (pfile, warn_long_long) = !CPP_OPTION (pfile, c99);
220 CPP_OPTION (pfile, pending) =
221 (struct cpp_pending *) xcalloc (1, sizeof (struct cpp_pending));
223 /* Default CPP arithmetic to something sensible for the host for the
224 benefit of dumb users like fix-header. */
225 CPP_OPTION (pfile, precision) = CHAR_BIT * sizeof (long);
226 CPP_OPTION (pfile, char_precision) = CHAR_BIT;
227 CPP_OPTION (pfile, wchar_precision) = CHAR_BIT * sizeof (int);
228 CPP_OPTION (pfile, int_precision) = CHAR_BIT * sizeof (int);
229 CPP_OPTION (pfile, unsigned_char) = 0;
230 CPP_OPTION (pfile, unsigned_wchar) = 1;
232 /* Initialize the line map. Start at logical line 1, so we can use
233 a line number of zero for special states. */
234 init_line_maps (&pfile->line_maps);
237 /* Initialize lexer state. */
238 pfile->state.save_comments = ! CPP_OPTION (pfile, discard_comments);
240 /* Set up static tokens. */
241 pfile->avoid_paste.type = CPP_PADDING;
242 pfile->avoid_paste.val.source = NULL;
243 pfile->eof.type = CPP_EOF;
244 pfile->eof.flags = 0;
246 /* Create a token buffer for the lexer. */
247 _cpp_init_tokenrun (&pfile->base_run, 250);
248 pfile->cur_run = &pfile->base_run;
249 pfile->cur_token = pfile->base_run.base;
251 /* Initialize the base context. */
252 pfile->context = &pfile->base_context;
253 pfile->base_context.macro = 0;
254 pfile->base_context.prev = pfile->base_context.next = 0;
256 /* Aligned and unaligned storage. */
257 pfile->a_buff = _cpp_get_buff (pfile, 0);
258 pfile->u_buff = _cpp_get_buff (pfile, 0);
260 /* The expression parser stack. */
261 _cpp_expand_op_stack (pfile);
263 /* Initialize the buffer obstack. */
264 gcc_obstack_init (&pfile->buffer_ob);
266 _cpp_init_includes (pfile);
271 /* Free resources used by PFILE. Accessing PFILE after this function
272 returns leads to undefined behavior. Returns the error count. */
277 cpp_context *context, *contextn;
278 tokenrun *run, *runn;
280 free (CPP_OPTION (pfile, pending));
281 free (pfile->op_stack);
283 while (CPP_BUFFER (pfile) != NULL)
284 _cpp_pop_buffer (pfile);
287 free (pfile->out.base);
289 if (pfile->macro_buffer)
291 free ((PTR) pfile->macro_buffer);
292 pfile->macro_buffer = NULL;
293 pfile->macro_buffer_len = 0;
297 deps_free (pfile->deps);
298 obstack_free (&pfile->buffer_ob, 0);
300 _cpp_destroy_hashtable (pfile);
301 _cpp_cleanup_includes (pfile);
303 _cpp_free_buff (pfile->a_buff);
304 _cpp_free_buff (pfile->u_buff);
305 _cpp_free_buff (pfile->free_buffs);
307 for (run = &pfile->base_run; run; run = runn)
311 if (run != &pfile->base_run)
315 for (context = pfile->base_context.next; context; context = contextn)
317 contextn = context->next;
321 free_line_maps (&pfile->line_maps);
325 /* This structure defines one built-in identifier. A node will be
326 entered in the hash table under the name NAME, with value VALUE.
328 There are two tables of these. builtin_array holds all the
329 "builtin" macros: these are handled by builtin_macro() in
330 cppmacro.c. Builtin is somewhat of a misnomer -- the property of
331 interest is that these macros require special code to compute their
332 expansions. The value is a "builtin_type" enumerator.
334 operator_array holds the C++ named operators. These are keywords
335 which act as aliases for punctuators. In C++, they cannot be
336 altered through #define, and #if recognizes them as operators. In
337 C, these are not entered into the hash table at all (but see
338 <iso646.h>). The value is a token-type enumerator. */
343 unsigned short value;
346 #define B(n, t) { DSC(n), t }
347 static const struct builtin builtin_array[] =
349 B("__TIME__", BT_TIME),
350 B("__DATE__", BT_DATE),
351 B("__FILE__", BT_FILE),
352 B("__BASE_FILE__", BT_BASE_FILE),
353 B("__LINE__", BT_SPECLINE),
354 B("__INCLUDE_LEVEL__", BT_INCLUDE_LEVEL),
355 /* Keep builtins not used for -traditional-cpp at the end, and
356 update init_builtins() if any more are added. */
357 B("_Pragma", BT_PRAGMA),
358 B("__STDC__", BT_STDC),
361 static const struct builtin operator_array[] =
363 B("and", CPP_AND_AND),
364 B("and_eq", CPP_AND_EQ),
365 B("bitand", CPP_AND),
367 B("compl", CPP_COMPL),
369 B("not_eq", CPP_NOT_EQ),
371 B("or_eq", CPP_OR_EQ),
373 B("xor_eq", CPP_XOR_EQ)
377 /* Mark the C++ named operators in the hash table. */
379 mark_named_operators (pfile)
382 const struct builtin *b;
384 for (b = operator_array;
385 b < (operator_array + ARRAY_SIZE (operator_array));
388 cpp_hashnode *hp = cpp_lookup (pfile, b->name, b->len);
389 hp->flags |= NODE_OPERATOR;
390 hp->is_directive = 0;
391 hp->directive_index = b->value;
395 /* Subroutine of cpp_read_main_file; reads the builtins table above and
396 enters them, and language-specific macros, into the hash table. */
398 init_builtins (pfile)
401 const struct builtin *b;
402 size_t n = ARRAY_SIZE (builtin_array);
404 if (CPP_OPTION (pfile, traditional))
407 for(b = builtin_array; b < builtin_array + n; b++)
409 cpp_hashnode *hp = cpp_lookup (pfile, b->name, b->len);
411 hp->flags |= NODE_BUILTIN | NODE_WARN;
412 hp->value.builtin = b->value;
415 if (CPP_OPTION (pfile, cplusplus))
416 _cpp_define_builtin (pfile, "__cplusplus 1");
417 else if (CPP_OPTION (pfile, lang) == CLK_ASM)
418 _cpp_define_builtin (pfile, "__ASSEMBLER__ 1");
419 else if (CPP_OPTION (pfile, lang) == CLK_STDC94)
420 _cpp_define_builtin (pfile, "__STDC_VERSION__ 199409L");
421 else if (CPP_OPTION (pfile, c99))
422 _cpp_define_builtin (pfile, "__STDC_VERSION__ 199901L");
424 if (CPP_OPTION (pfile, objc))
425 _cpp_define_builtin (pfile, "__OBJC__ 1");
427 if (pfile->cb.register_builtins)
428 (*pfile->cb.register_builtins) (pfile);
431 /* Frees a pending_option chain. */
434 struct pending_option *head;
436 struct pending_option *next;
446 /* Sanity-checks are dependent on command-line options, so it is
447 called as a subroutine of cpp_read_main_file (). */
449 static void sanity_checks PARAMS ((cpp_reader *));
450 static void sanity_checks (pfile)
454 size_t max_precision = 2 * CHAR_BIT * sizeof (cpp_num_part);
456 /* Sanity checks for assumptions about CPP arithmetic and target
457 type precisions made by cpplib. */
460 cpp_error (pfile, DL_ICE, "cppchar_t must be an unsigned type");
462 if (CPP_OPTION (pfile, precision) > max_precision)
463 cpp_error (pfile, DL_ICE,
464 "preprocessor arithmetic has maximum precision of %lu bits; target requires %lu bits",
465 (unsigned long) max_precision,
466 (unsigned long) CPP_OPTION (pfile, precision));
468 if (CPP_OPTION (pfile, precision) < CPP_OPTION (pfile, int_precision))
469 cpp_error (pfile, DL_ICE,
470 "CPP arithmetic must be at least as precise as a target int");
472 if (CPP_OPTION (pfile, char_precision) < 8)
473 cpp_error (pfile, DL_ICE, "target char is less than 8 bits wide");
475 if (CPP_OPTION (pfile, wchar_precision) < CPP_OPTION (pfile, char_precision))
476 cpp_error (pfile, DL_ICE,
477 "target wchar_t is narrower than target char");
479 if (CPP_OPTION (pfile, int_precision) < CPP_OPTION (pfile, char_precision))
480 cpp_error (pfile, DL_ICE,
481 "target int is narrower than target char");
483 /* This is assumed in eval_token() and could be fixed if necessary. */
484 if (sizeof (cppchar_t) > sizeof (cpp_num_part))
485 cpp_error (pfile, DL_ICE, "CPP half-integer narrower than CPP character");
487 if (CPP_OPTION (pfile, wchar_precision) > BITS_PER_CPPCHAR_T)
488 cpp_error (pfile, DL_ICE,
489 "CPP on this host cannot handle wide character constants over %lu bits, but the target requires %lu bits",
490 (unsigned long) BITS_PER_CPPCHAR_T,
491 (unsigned long) CPP_OPTION (pfile, wchar_precision));
494 # define sanity_checks(PFILE)
497 /* Add a dependency target. Can be called any number of times before
498 cpp_read_main_file(). If no targets have been added before
499 cpp_read_main_file(), then the default target is used. */
501 cpp_add_dependency_target (pfile, target, quote)
507 pfile->deps = deps_init ();
509 deps_add_target (pfile->deps, target, quote);
512 /* This is called after options have been parsed, and partially
513 processed. Setup for processing input from the file named FNAME,
514 or stdin if it is the empty string. Return the original filename
515 on success (e.g. foo.i->foo.c), or NULL on failure. */
517 cpp_read_main_file (pfile, fname, table)
522 sanity_checks (pfile);
524 post_options (pfile);
526 /* The front ends don't set up the hash table until they have
527 finished processing the command line options, so initializing the
528 hashtable is deferred until now. */
529 _cpp_init_hashtable (pfile, table);
531 /* Mark named operators before handling command line macros. */
532 if (CPP_OPTION (pfile, cplusplus) && CPP_OPTION (pfile, operator_names))
533 mark_named_operators (pfile);
535 if (CPP_OPTION (pfile, deps.style) != DEPS_NONE)
538 pfile->deps = deps_init ();
540 /* Set the default target (if there is none already). */
541 deps_add_default_target (pfile->deps, fname);
544 /* Open the main input file. */
545 if (!_cpp_read_file (pfile, fname))
548 /* Set this here so the client can change the option if it wishes,
549 and after stacking the main file so we don't trace the main
551 pfile->line_maps.trace_includes = CPP_OPTION (pfile, print_include_names);
553 /* For foo.i, read the original filename foo.c now, for the benefit
554 of the front ends. */
555 if (CPP_OPTION (pfile, preprocessed))
556 read_original_filename (pfile);
558 return pfile->map->to_file;
561 /* For preprocessed files, if the first tokens are of the form # NUM.
562 handle the directive so we know the original file name. This will
563 generate file_change callbacks, which the front ends must handle
564 appropriately given their state of initialization. */
566 read_original_filename (pfile)
569 const cpp_token *token, *token1;
571 /* Lex ahead; if the first tokens are of the form # NUM, then
572 process the directive, otherwise back up. */
573 token = _cpp_lex_direct (pfile);
574 if (token->type == CPP_HASH)
576 token1 = _cpp_lex_direct (pfile);
577 _cpp_backup_tokens (pfile, 1);
579 /* If it's a #line directive, handle it. */
580 if (token1->type == CPP_NUMBER)
582 _cpp_handle_directive (pfile, token->flags & PREV_WHITE);
587 /* Backup as if nothing happened. */
588 _cpp_backup_tokens (pfile, 1);
591 /* Handle pending command line options: -D, -U, -A, -imacros and
592 -include. This should be called after debugging has been properly
593 set up in the front ends. */
595 cpp_finish_options (pfile)
598 /* Install builtins and process command line macros etc. in the order
599 they appeared, but only if not already preprocessed. */
600 if (! CPP_OPTION (pfile, preprocessed))
602 struct pending_option *p;
604 _cpp_do_file_change (pfile, LC_RENAME, _("<built-in>"), 1, 0);
605 init_builtins (pfile);
606 _cpp_do_file_change (pfile, LC_RENAME, _("<command line>"), 1, 0);
607 for (p = CPP_OPTION (pfile, pending)->directive_head; p; p = p->next)
608 (*p->handler) (pfile, p->arg);
610 /* Scan -imacros files after -D, -U, but before -include.
611 pfile->next_include_file is NULL, so _cpp_pop_buffer does not
612 push -include files. */
613 for (p = CPP_OPTION (pfile, pending)->imacros_head; p; p = p->next)
614 if (cpp_push_include (pfile, p->arg))
615 cpp_scan_nooutput (pfile);
618 free_chain (CPP_OPTION (pfile, pending)->imacros_head);
619 free_chain (CPP_OPTION (pfile, pending)->directive_head);
622 /* This is called at the end of preprocessing. It pops the last
623 buffer and writes dependency output, and returns the number of
626 Maybe it should also reset state, such that you could call
627 cpp_start_read with a new filename to restart processing. */
629 cpp_finish (pfile, deps_stream)
633 /* Warn about unused macros before popping the final buffer. */
634 if (CPP_OPTION (pfile, warn_unused_macros))
635 cpp_forall_identifiers (pfile, _cpp_warn_if_unused_macro, NULL);
637 /* cpplex.c leaves the final buffer on the stack. This it so that
638 it returns an unending stream of CPP_EOFs to the client. If we
639 popped the buffer, we'd dereference a NULL buffer pointer and
640 segfault. It's nice to allow the client to do worry-free excess
641 cpp_get_token calls. */
642 while (pfile->buffer)
643 _cpp_pop_buffer (pfile);
645 /* Don't write the deps file if there are errors. */
646 if (CPP_OPTION (pfile, deps.style) != DEPS_NONE
647 && deps_stream && pfile->errors == 0)
649 deps_write (pfile->deps, deps_stream, 72);
651 if (CPP_OPTION (pfile, deps.phony_targets))
652 deps_phony_targets (pfile->deps, deps_stream);
655 /* Report on headers that could use multiple include guards. */
656 if (CPP_OPTION (pfile, print_include_names))
657 _cpp_report_missing_guards (pfile);
659 return pfile->errors;
662 /* Add a directive to be handled later in the initialization phase. */
664 new_pending_directive (pend, text, handler)
665 struct cpp_pending *pend;
667 cl_directive_handler handler;
669 struct pending_option *o = (struct pending_option *)
670 xmalloc (sizeof (struct pending_option));
674 o->handler = handler;
675 APPEND (pend, directive, o);
678 /* Irix6 "cc -n32" and OSF4 cc have problems with char foo[] = ("string");
679 I.e. a const string initializer with parens around it. That is
680 what N_("string") resolves to, so we make no_* be macros instead. */
681 #define no_ass N_("assertion missing after %s")
682 #define no_fil N_("file name missing after %s")
683 #define no_mac N_("macro name missing after %s")
685 /* This is the list of all command line options, with the leading
686 "-" removed. It must be sorted in ASCII collating order. */
687 #define COMMAND_LINE_OPTIONS \
688 DEF_OPT("A", no_ass, OPT_A) \
689 DEF_OPT("D", no_mac, OPT_D) \
690 DEF_OPT("U", no_mac, OPT_U) \
691 DEF_OPT("imacros", no_fil, OPT_imacros) \
694 #define DEF_OPT(text, msg, code) code,
704 const char *opt_text;
707 enum opt_code opt_code;
710 #define DEF_OPT(text, msg, code) { text, msg, sizeof(text) - 1, code },
712 static struct cl_option cl_options[] =
714 static const struct cl_option cl_options[] =
720 #undef COMMAND_LINE_OPTIONS
722 /* Perform a binary search to find which, if any, option the given
723 command-line matches. Returns its index in the option array,
724 negative on failure. Complications arise since some options can be
725 suffixed with an argument, and multiple complete matches can occur,
726 e.g. -pedantic and -pedantic-errors. */
731 unsigned int md, mn, mx;
742 opt_len = cl_options[md].opt_len;
743 comp = strncmp (input, cl_options[md].opt_text, opt_len);
751 if (input[opt_len] == '\0')
753 /* We were passed more text. If the option takes an argument,
754 we may match a later option or we may have been passed the
755 argument. The longest possible option match succeeds.
756 If the option takes no arguments we have not matched and
757 continue the search (e.g. input="stdc++" match was "stdc"). */
759 if (cl_options[md].msg)
761 /* Scan forwards. If we get an exact match, return it.
762 Otherwise, return the longest option-accepting match.
763 This loops no more than twice with current options. */
765 for (; mn < (unsigned int) N_OPTS; mn++)
767 opt_len = cl_options[mn].opt_len;
768 if (strncmp (input, cl_options[mn].opt_text, opt_len))
770 if (input[opt_len] == '\0')
772 if (cl_options[mn].msg)
783 /* Handle one command-line option in (argc, argv).
784 Can be called multiple times, to handle multiple sets of options.
785 Returns number of strings consumed. */
787 cpp_handle_option (pfile, argc, argv)
793 struct cpp_pending *pend = CPP_OPTION (pfile, pending);
796 enum opt_code opt_code;
801 opt_index = parse_option (&argv[i][1]);
805 opt_code = cl_options[opt_index].opt_code;
806 if (cl_options[opt_index].msg)
808 arg = &argv[i][cl_options[opt_index].opt_len + 1];
814 cpp_error (pfile, DL_ERROR,
815 cl_options[opt_index].msg, argv[i - 1]);
823 case N_OPTS: /* Shut GCC up. */
827 new_pending_directive (pend, arg, cpp_define);
833 /* -A with an argument beginning with '-' acts as
834 #unassert on whatever immediately follows the '-'.
835 If "-" is the whole argument, we eliminate all
836 predefined macros and assertions, including those
837 that were specified earlier on the command line.
838 That way we can get rid of any that were passed
839 automatically in from GCC. */
843 free_chain (pend->directive_head);
844 pend->directive_head = NULL;
845 pend->directive_tail = NULL;
848 new_pending_directive (pend, arg + 1, cpp_unassert);
851 new_pending_directive (pend, arg, cpp_assert);
854 new_pending_directive (pend, arg, cpp_undef);
858 struct pending_option *o = (struct pending_option *)
859 xmalloc (sizeof (struct pending_option));
863 APPEND (pend, imacros, o);
875 /* -Wtraditional is not useful in C++ mode. */
876 if (CPP_OPTION (pfile, cplusplus))
877 CPP_OPTION (pfile, warn_traditional) = 0;
879 /* Permanently disable macro expansion if we are rescanning
880 preprocessed text. Read preprocesed source in ISO mode. */
881 if (CPP_OPTION (pfile, preprocessed))
883 pfile->state.prevent_expansion = 1;
884 CPP_OPTION (pfile, traditional) = 0;
887 /* Traditional CPP does not accurately track column information. */
888 if (CPP_OPTION (pfile, traditional))
889 CPP_OPTION (pfile, show_column) = 0;