1 2008-05-21 Tom Tromey <tromey@redhat.com>
3 * include/symtab.h (HT_ALLOCED): Remove.
5 * symtab.c (DELETED): New define.
6 (ht_lookup): Update comment.
7 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
8 code. Use subobject allocator for strings, if it exists.
9 (ht_expand): Handle deleted entries.
10 (ht_forall): Likewise.
11 (ht_purge): New function.
12 (ht_dump_statistics): Print deletion statistics.
14 2008-05-13 Tom Tromey <tromey@redhat.com>
16 PR preprocessor/22168:
17 * include/cpplib.h (struct cpp_options) <objc>: Update
19 * expr.c (eval_token): Warn for use of assertions.
20 * directives.c (directive_diagnostics): Warn about extensions.
21 (DEPRECATED): New define.
22 (DIRECTIVE_TABLE): Use it.
24 2008-05-06 Tom Tromey <tromey@redhat.com>
26 PR preprocessor/35313, PR preprocessor/36088:
27 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
28 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
30 2008-05-04 David S. Miller <davem@davemloft.net>
32 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
33 * configure: Regenerate.
35 2008-04-22 Daniel Franke <franke.daniel@gmail.com>
37 * include/cpplib.h (cpp_define_formatted): New.
38 * directives.c (cpp_define_formatted): New.
40 2008-04-21 Tom Tromey <tromey@redhat.com>
43 * charset.c (_cpp_convert_input): Add buffer_start argument.
44 Ignore UTF-8 BOM if seen.
45 * internal.h (_cpp_convert_input): Add argument.
46 * files.c (struct _cpp_file) <buffer_start>: New field.
47 (destroy_cpp_file): Free buffer_start, not buffer.
48 (_cpp_pop_file_buffer): Likewise.
49 (read_file_guts): Update.
51 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
53 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
54 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
55 (struct cpp_options): Added uliterals.
56 (cpp_interpret_string): Update prototype.
57 (cpp_interpret_string_notranslate): Idem.
58 * charset.c (init_iconv_desc): New width member in cset_converter.
59 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
61 (emit_numeric_escape): Idem.
64 (convert_escape): Idem.
65 (converter_for_type): New function.
66 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
67 (cpp_interpret_string_notranslate): Match changed prototype.
68 (wide_str_to_charconst): Use converter_for_type.
69 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
70 * directives.c (linemarker_dir): Macro U changed to UC.
71 (parse_include): Idem.
72 (register_pragma_1): Idem.
73 (restore_registered_pragmas): Idem.
74 (get__Pragma_string): Support CPP_STRING{16,32}.
75 * expr.c (eval_token): Support CPP_CHAR{16,32}.
76 * init.c (struct lang_flags): Added uliterals.
77 (lang_defaults): Idem.
78 * internal.h (struct cset_converter) <width>: New field.
79 (struct cpp_reader) <char16_cset_desc>: Idem.
80 (struct cpp_reader) <char32_cset_desc>: Idem.
81 * lex.c (digraph_spellings): Macro U changed to UC.
83 (lex_string): Add support for u'...', U'...', u"..." and U"...".
84 (_cpp_lex_direct): Idem.
85 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
86 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
88 2008-04-18 Paolo Bonzini <bonzini@gnu.org>
91 * aclocal.m4: Regenerate.
92 * configure: Regenerate.
94 2008-04-17 Tom Tromey <tromey@redhat.com>
97 * errors.c (cpp_error): Don't reference a token before the start
100 2008-04-16 Tom Tromey <tromey@redhat.com>
102 * Makefile.in (TAGS_SOURCES): New variable.
105 2008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
107 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
109 * configure: Rebuilt.
111 2008-04-02 Joseph Myers <joseph@codesourcery.com>
113 * include/cpplib.h (struct cpp_callbacks): Add used_define,
114 used_undef and before_define.
116 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
117 do_ifndef, cpp_pop_definition): Handle new flag and use new
119 * expr.c (parse_defined): Handle new flag and use new callbacks.
120 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
121 flag and use new callbacks.
123 2008-04-01 Jakub Jelinek <jakub@redhat.com>
126 * files.c (struct _cpp_file): Remove pch field.
127 (pch_open_file): Don't set file->pch, just file->pchname.
128 (should_stack_file): After pfile->cb.read_pch call
129 free pchname and clear pchname, don't close file->fd.
130 Test file->pchname instead of file->pch. Don't close fd after cb.
131 (_cpp_stack_include): Test file->pchname instead of file->pch.
133 2008-03-28 Tom Tromey <tromey@redhat.com>
135 * Makefile.in (POSTCOMPILE): New variable.
138 2008-03-13 Tom Tromey <tromey@redhat.com>
141 * directives.c (destringize_and_run): Set pfile->directive.
143 2008-03-06 Markus Milleder <markus.milleder@generali.at>
145 PR preprocessor/35458
146 * mkdeps.c (munge): Quote '#' with a '\'.
148 2008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
150 PR preprocessor/35379
151 * mkdeps.c (deps_write): Ensure the first target always appears
152 in the first column, without leading backslash newline. Avoid
153 some more extra whitespace.
155 2008-02-25 Thiemo Seufer <ths@mips.com>
157 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
159 2008-02-19 Tom Tromey <tromey@redhat.com>
161 * traditional.c (lex_identifier): Use CPP_HASHNODE.
162 * lex.c (lex_identifier): Use CPP_HASHNODE.
163 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
165 * identifiers.c (alloc_node): Change return type.
166 (_cpp_init_hashtable): Don't cast 'alloc_node'.
167 (proxy_assertion_broken): New declaration.
168 (cpp_forall_identifiers): Move comment.
169 * line-map.c (linemap_add): Comment fix.
170 (linemap_line_start): Indentation fix.
172 2008-01-25 Jakub Jelinek <jakub@redhat.com>
174 PR preprocessor/34692
175 * macro.c (collect_args): Add pragma_buff argument. Push
176 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
177 than into arguments. Reset prevent_expansion and parsing_args
178 state at CPP_PRAGMA_EOL/CPP_EOF.
179 (funlike_invocation_p): Add pragma_buff argument, pass it through
181 (enter_macro_context): Add result argument. Adjust
182 funlike_invocation_p caller. Emit all deferred pragma tokens
183 gathered during collect_args before the expansion, add a padding
184 token. Return 2 instead of 1 if any pragma tokens were prepended.
185 (cpp_get_token): If enter_macro_context returns 2, don't return
186 a padding token, instead cycle to grab CPP_PRAGMA token.
187 * directives.c (_cpp_handle_directive): If was_parsing_args
188 in deferred pragma, leave parsing_args and prevent_expansion as is.
190 2008-01-22 Tom Tromey <tromey@redhat.com>
193 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
194 __STDC_CONSTANT_MACROS.
196 2008-01-07 Fred Fish <fnf@specifix.com>
198 PR preprocessor/30363
199 * traditional.c (replace_args_and_push): Add local variable
200 cxtquote, calculate the replacement text size assuming a
201 worst case of every input character quoted with backslash,
202 and properly handle output quoting of quote characters in
203 actual arguments used in function-like macros.
205 2008-01-03 Tom Tromey <tromey@redhat.com>
207 PR preprocessor/34602
208 * directives.c (do_line): Don't try to spell EOF token.
209 (do_linemarker): Add comment.
211 2007-12-11 DJ Delorie <dj@redhat.com>
213 * charset.c (convert_using_iconv): Close out any shift states,
214 returning to the initial state.
216 2007-12-06 Tom Tromey <tromey@redhat.com>
219 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
221 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
222 * files.c (FILE_HASH_POOL_SIZE): New macro.
223 (struct file_hash_entry_pool): New.
224 (destroy_all_cpp_files): New function.
225 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
226 (new_file_hash_entry): Update.
227 (free_file_hash_entries): New function.
228 (_cpp_cleanup_files): Call free_file_hash_entries and
229 destroy_all_cpp_files.
230 (cpp_clear_file_cache): New function.
231 * include/cpplib.h (cpp_clear_file_cache): Declare.
233 2007-12-03 Tom Tromey <tromey@redhat.com>
235 PR preprocessor/34288
236 * configure.ac, config.in: Rebuilt.
237 * configure.ac: Check for ssize_t.
239 2007-11-30 Tom Tromey <tromey@redhat.com>
241 PR preprocessor/32868
242 * macro.c (_cpp_create_definition): Special case
243 __STDC_FORMAT_MACROS.
245 2007-11-16 Michael Matz <matz@suse.de>
247 * files.c (search_path_head): Fix check for absolute paths.
249 2007-11-11 Tom Tromey <tromey@redhat.com>
252 * include/cpplib.h (cpp_included_before): Declare.
253 * files.c (struct file_hash_entry) <location>: New field.
254 (_cpp_find_file): Initialize new field.
255 (make_cpp_dir): Likewise.
256 (cpp_included_before): New function.
258 2007-11-01 Tom Tromey <tromey@redhat.com>
260 PR preprocessor/30805
261 * macro.c (paste_tokens): Handle padding token.
262 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
264 2007-10-31 Tom Tromey <tromey@redhat.com>
266 PR preprocessor/30786
267 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
268 * directives.c (_cpp_do__Pragma): Return error status.
269 * internal.h (_cpp_do__Pragma): Update.
270 * directives.c (get__Pragma_string): Back up if EOF seen.
272 2007-09-06 Tom Tromey <tromey@redhat.com>
274 * internal.h (struct cpp_reader) <invocation_location>: New
276 (struct cpp_reader) <set_invocation_location>: Likewise.
277 * init.c (cpp_set_line_map): New function.
278 * line-map.c (linemap_add): Use linemap's allocator.
279 * include/line-map.h (GTY): Define.
280 (line_map_realloc): New typedef.
281 (struct line_map): Mark with GTY.
282 (struct line_maps): Likewise.
283 (struct line_maps) <maps>: Likewise.
284 (struct line_maps) <reallocator>: New field.
285 * include/symtab.h (GTY): Conditionally define.
286 * include/cpplib.h (cpp_set_line_map): Declare.
287 (cpp_get_token_with_location): Declare.
288 * macro.c (cpp_get_token): Set invocation_location on the reader.
289 (cpp_get_token_with_location): New function.
291 2007-08-30 Chao-ying Fu <fu@mips.com>
293 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
294 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
295 (cpp_classify_number): Support decimal fixed-point constants without
297 Warn about fixed-point constants when -pedantic.
298 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
299 comments to support fixed-point values.
300 (CPP_N_FRACT, CPP_N_ACCUM): Define.
302 2007-08-18 Tom Tromey <tromey@redhat.com>
304 PR preprocessor/32974
305 * directives.c (parse_include): Don't check for EOL when
306 processing #pragma dependency.
308 2007-07-30 Ollie Wild <aaw@google.com>
310 * directives-only.c: New file.
311 * internal.h (struct _cpp_dir_only_callbacks): New.
312 (_cpp_preprocess_dir_only): New function.
313 * directives.c (_cpp_handle_directive): Check directives_only before
314 disabling execution of indented directives.
315 * files.c (_cpp_stack_file): Add directives_only check.
316 * include/cpplib.h (struct cpp_options): Add directives_only.
317 (cpp_init_special_builtins): New function.
318 * init.c (cpp_init_special_builtins): New function.
319 (cpp_init_builtins): Move builtin_array initialization to
320 cpp_init_special_builtins.
321 (post_options): Check directives_only before setting
322 pfile->state.prevent_expansion = 1.
323 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
324 is expanded inside a directive while -fdirectives-only is enabled.
325 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
326 (libcpp_a_SOURCES): Add directives-only.c.
328 2007-07-04 Uros Bizjak <ubizjak@gmail.com>
330 * traditional.c (_cpp_scan_out_logical_line): Initialize
331 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
332 fmacro.args to prevent 'may be used uninitialized' warning.
334 2007-07-03 Uros Bizjak <ubizjak@gmail.com>
336 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
338 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
339 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
340 for 'q' or 'Q' suffixes.
342 2007-06-17 Danny Smith <dannysmith@users.sourceforge.net
344 * files.c (open_file): Correct typo.
346 2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
348 * files.c (open_file): Prevent the call
349 for stat from overwriting errno.
351 2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
353 * files.c (open_file): Account for the
354 fact that on windows, opening a directory gives
357 2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
359 PR preprocessor/23479
360 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
362 (append_digit): Likewise.
363 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
364 binary integer constants.
366 2007-05-31 Dave Korn <dave.korn@artimi.com>
368 PR preprocessor/14331
369 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
371 2007-05-24 Ollie Wild <aaw@google.com>
373 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
374 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
375 (cpp_write_pch_state): Save __COUNTER__ state.
376 (cpp_valid_state): Check valid __COUNTER__ state.
377 (cpp_read_state): Read new __COUNTER__ state.
378 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
379 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
380 * internal.h (struct cpp_reader): Add counter member.
382 2007-05-23 Simon Martin <simartin@users.sourceforge.net>
384 PR preprocessor/20077
385 * macro.c (create_iso_definition): Fixed the method to determine
386 whether the token-pasting operator appears at the beginning or the end
389 2007-05-21 Ian Lance Taylor <iant@google.com>
391 * internal.h (struct cpp_reader): Add new fields:
392 nonexistent_file_hash and nonexistent_file_ob.
393 * files.c: Include "obstack.h".
394 (find_file_in_dir): Before trying to open the file, look up the
395 path name in the hash table of nonexistent files. After failing
396 to open the file, add the path name to the hash table.
397 (_cpp_find_file): Cache the results of looking up the file name
398 starting with the quote and bracket chain heads, if we can.
399 (nonexistent_file_hash_eq): New static function.
400 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
401 pfile->nonexistent_file_ob.
402 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
403 pfile->nonexistent_file_ob.
405 2007-05-14 Janis Johnson <janis187@us.ibm.com>
407 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
410 * expr.c (interpret_float_suffix): Check for invalid suffix.
412 2007-05-02 Eric Christopher <echristo@apple.com>
414 * expr.c (num_div_op): Don't overflow if the result is
417 2007-05-02 Tom Tromey <tromey@redhat.com>
419 PR preprocessor/28709
420 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
422 2007-03-30 Michael Meissner <michael.meissner@amd.com>
424 * directives.c (lex_macro_node_from_str): Fix alloca call to be
427 2007-03-30 Richard Henderson <rth@redhat.com>
429 * directives.c (lex_macro_node_from_str): New.
430 (cpp_push_definition, cpp_pop_definition): New.
431 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
433 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
435 * Makefile.in: Add dummy install-pdf target.
437 2007-01-30 Tom Tromey <tromey@redhat.com>
439 PR preprocessor/30468
440 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
443 2007-01-30 Tom Tromey <tromey@redhat.com>
445 PR preprocessor/29966
446 * macro.c (lex_expansion_token): Save and restore cpp_reader's
448 (_cpp_create_definition): Don't restore cur_token here.
449 * lex.c (_cpp_lex_token): Added assertion.
451 2007-01-27 Tom Tromey <tromey@redhat.com>
453 * configure: Rebuilt.
455 2007-01-12 Tom Tromey <tromey@redhat.com>
457 PR preprocessor/28227
458 * directives.c (lex_macro_node): Added 'is_def_or_undef'
465 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
467 * configure: Regenerate.
469 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
471 * configure: Regenerate.
473 2007-01-04 Tom Tromey <tromey@redhat.com>
475 PR preprocessor/28165
476 * internal.h (cpp_in_primary_file): New function.
477 * directives.c (do_include_next): Use cpp_in_primary_file.
478 (do_pragma_once): Likewise.
479 (do_pragma_system_header): Likewise.
481 2006-12-29 Ian Lance Taylor <iant@google.com>
483 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
484 look backward at the end of the line unless we saw a backslash.
486 2006-12-29 Jakub Jelinek <jakub@redhat.com>
488 PR preprocessor/29612
489 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
490 only when new_sysp is non-zero.
492 2006-12-28 Tom Tromey <tromey@redhat.com>
494 PR preprocessor/30001
495 * charset.c (_cpp_convert_input): Check that to.len is greater
498 2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
500 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
501 * configure: Rebuilt.
503 2006-11-01 Douglas Gregor <doug.gregor@gmail.com>
505 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
506 for experimental C++0x mode.
507 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
508 adopted the preprocessor changes introduced in C99.
510 2006-10-29 Joseph Myers <joseph@codesourcery.com>
512 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
513 depending on --enable-targets=all.
514 * configure: Regenerate.
516 2006-10-12 Jakub Jelinek <jakub@redhat.com>
518 PR preprocessor/28709
519 * macro.c (paste_tokens): Do error reporting here, use BUF with the
520 spelled LHS token as opposed to spelling it again.
521 (paste_all_tokens): Don't report errors here, just break on failure.
523 2006-10-10 Brooks Moses <bmoses@stanford.edu>
525 * Makefile.in: Added empty "pdf" target.
527 2006-09-22 Geoffrey Keating <geoffk@apple.com>
529 * configure.ac: Make need_64_bit_hwint case for x86-darwin
530 match exactly the glob in gcc/config.gcc.
531 * configure: Regenerate.
533 2006-09-13 Joseph S. Myers <joseph@codesourcery.com>
536 PR preprocessor/14634
537 * lex.c (lex_string): Pedwarn for unterminated literals.
539 2006-09-08 Eric Christopher <echristo@apple.com>
541 * configure.ac: Add 64-bit HWI support for i?86-darwin.
543 2006-08-14 Steve Ellcey <sje@cup.hp.com>
547 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
548 (CPP_LAST_EQ): Change.
549 (CPP_LAST_PUNCTUATOR): Change.
550 * expr.c (cpp_operator): Remove MIN and MAX.
551 (reduce): Remove CPP_MIN and CPP_MAX.
552 (num_binary_op): Ditto.
553 * lex.c (_cpp_lex_direct): Ditto.
554 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
556 2006-06-09 Jakub Jelinek <jakub@redhat.com>
558 PR preprocessor/27746
559 * directives.c (do_pragma): Handle pragma with valid namespace
560 and invalid name coming from macro expansion.
561 * directives.c (destringize_and_run): Initialize next field in
566 * directives.c (destringize_and_run): Set NO_EXPAND on the
569 * macro.c (_cpp_backup_tokens): Fix comment typo.
571 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
573 * Makefile.in (CATALOGS): Add po/ prefix.
574 * configure: Regenerated.
576 2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
578 * Makefile.in: Add install-html target. Add install-html to .PHONY
580 2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
582 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
583 * files.c (_cpp_get_file_stat): New function.
584 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
585 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
586 * internal.h (_cpp_get_file_stat): Prototype.
587 (struct cpp_buffer): Add timestamp.
589 2006-01-23 Jakub Jelinek <jakub@redhat.com>
591 PR preprocessor/25717
592 * init.c (cpp_init_builtins): If __STDC__ will not change value
593 between system headers and other sources, define it as a normal
594 macro rather than a builtin.
595 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
596 cpp_in_system_header condition.
598 2006-01-05 Paolo Bonzini <bonzini@gnu.org>
600 * Makefile.in: Use -MMD instead of -MD.
602 2006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
603 Richard Henderson <rth@redhat.com>
605 Merge from gomp branch:
606 * directives.c (struct pragma_entry): Add is_deferred. Add ident
607 entry to value union.
608 (end_directive): Don't eat the line if in_deferred_pragma.
609 (run_directive): Remove pragma hacks.
610 (insert_pragma_entry): Remove.
611 (new_pragma_entry): New.
612 (register_pragma_1): Split out of register_pragma. Only handle
613 the lookup tree and return the new entry.
614 (cpp_register_pragma): Fill in the pragma entry here.
615 (cpp_register_deferred_pragma): New.
616 (register_pragma_internal): New.
617 (_cpp_init_internal_pragmas): Use register_pragma_internal.
618 (do_pragma): Allow pragma expansion after namespace. For deferred
619 pragmas, don't slurp the line into a string.
620 (destringize_and_run): Save tokens for deferred pragmas.
621 (cpp_handle_deferred_pragma): Remove.
622 * macro.c (builtin_macro): Remove pragma token hack.
623 (_cpp_push_token_context): Rename from push_token_context and export.
624 * internal.h (struct lexer_state): Add pragma_allow_expansion.
625 (_cpp_push_token_context): Declare.
626 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
627 a token. Update the line number correctly if so.
628 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
629 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
630 * include/cpplib.h (PRAGMA_EOL): New.
631 (CPP_TOKEN_FLD_PRAGMA): New.
632 (struct cpp_token): Add val.pragma.
633 (struct cpp_options): Remove defer_pragmas.
634 (cpp_handle_deferred_pragma): Remove.
635 (cpp_register_deferred_pragma): Declare.
637 2006-01-01 Jakub Jelinek <jakub@redhat.com>
640 * directives.c (do_pragma): If pragma line ends with multi-line
641 block comment, end the saved deferred pragma string before that
642 comment. Handle embedded '\0' chars on the pragma line.
644 2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
647 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
649 2005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
650 Ben Elliston <bje@au.ibm.com>
652 * include/cpplib.h (CPP_N_DFLOAT): New.
653 * expr.c (interpret_float_suffix): Identify df, dd, and dl
654 suffixes as decimal floating point constants.
655 (cpp_classify_number): Disallow hexadecimal DFP constants.
657 2005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
658 Ian Lance Taylor <ian@airs.com>
660 * include/cpplib.h (struct cpp_callbacks): Annotate error with
661 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
663 2005-11-09 Per Bothner <per@bothner.com>
664 Uros Bizjak <uros@kss-loka.si>
667 * init.c (read_original_filename): Temporarily set
668 state.in_directive before calling _cpp_lex_direct for
671 2005-11-03 James E Wilson <wilson@specifix.com>
673 PR preprocessor/24202
674 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
676 2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
678 * include/cpplib.h (struct cpp_callbacks): Make error take
680 * errors.c (cpp_error): Update call to callback.
682 2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
684 PR preprocessor/22042
685 * macro.c (_cpp_builtin_macro_text): Lower the needed max
687 (cpp_quote_string): Don't octalify non printable
690 2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
693 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
694 (struct cpp_callbacks): Add error.
695 * errors.c (cpp_error): If client_diagnostic, use error callback.
696 * charset.c (convert_escape): Don't use %03o in diagnostic.
698 2005-10-21 James E Wilson <wilson@specifix.com>
700 PR preprocessor/15220
701 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
702 callers. Pass to open_file_failed.
703 (open_file_failed): New parameter angle_brackets. Fix all callers.
704 Use in print_dep assignment.
705 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
706 * internal.h (_cpp_find_file): Add new parm to declaration.
708 2005-10-08 Kazu Hirata <kazu@codesourcery.com>
710 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
711 * configure: Regenerate.
713 2005-10-04 Ian Lance Taylor <ian@airs.com>
715 PR preprocessor/13726
716 * directives.c (check_eol_return_comments): New static function.
717 (parse_include): Add buf parameter. Change all callers.
718 (do_include_common): If not discard comments, turn on
719 save_comments. Pass collected comments to include callback.
720 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
721 include callback: cpp_token list.
723 2005-09-20 Joseph S. Myers <joseph@codesourcery.com>
725 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
726 * init.c (struct lang_flags, lang_defaults): Add
727 extended_identifiers.
728 (cpp_set_lang): Use it.
729 * lex.c (forms_identifier_p): Check extended_identifiers.
731 2005-08-30 Jakub Jelinek <jakub@redhat.com>
733 PR preprocessor/20348
734 PR preprocessor/20356
735 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
738 2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
740 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
741 -Wmissing-format-attribute.
743 * configure: Regenerate.
745 2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
747 * all files: Update FSF address in copyright headers.
748 * makeucnid.c (write_copyright): Update outputted FSF address.
750 2005-06-13 Zack Weinberg <zack@codesourcery.com>
752 * configure.ac: Invoke ZW_CREATE_DEPDIR and
753 ZW_PROG_COMPILER_DEPENDENCIES.
754 * aclocal.m4, configure: Regenerate.
755 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
757 (distclean): Clean up $(DEPDIR) and its contents.
758 (.c.o): Use $(COMPILE).
759 Include $(DEPDIR)/*.Po for most object->header dependencies.
761 2005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
763 * configure.ac: Check declarations for asprintf and vasprintf.
764 * config.in: Regenerate.
765 * configure: Likewise.
767 * charset.c (conversion_loop): Use XRESIZEVEC.
768 (convert_no_conversion): Likewise.
769 (convert_using_iconv): Likewise.
770 (init_iconv_desc): Cast return value of alloca.
771 (cpp_host_to_exec_charset): Use XNEWVEC.
772 (emit_numeric_escape): Use XRESIZEVEC.
773 (cpp_interpret_string): Use XNEWVEC.
774 (cpp_interpret_string): Use XRESIZEVEC.
775 (_cpp_interpret_identifier): Cast return value of alloca.
776 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
777 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
778 (parse_include): Use XNEWVEC.
779 (insert_pragma_entry): Rename local variable "new" to
781 (save_registered_pragmas): Cast return value of xmemdup.
782 (destringize_and_run): Same for alloca.
783 (parse_assertion): Likewise.
784 (do_assert): Cast allocated storage to proper type.
785 (cpp_define): Likewise.
786 (_cpp_define_builtin): Likewise.
787 (cpp_undef): Likewise.
788 (handle_assertion): Likewise.
789 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
790 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
791 (CPP_UMINUS): Likewise.
792 (struct cpp_operator): Rename from struct operator.
793 (_cpp_expand_op_stack): Use XRESIZEVEC.
794 * files.c (pch_open_file): Use XNEWVEC.
795 (pch_open_file): Use XRESIZEVEC.
796 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
797 (dir_name_of_file): Use XNEWVEC.
798 (make_cpp_file): Use XCNEW.
799 (make_cpp_dir): Likewise.
800 (allocate_file_hash_entries): USE XNEWVEC.
801 (cpp_included): Cast return value of htab_find_with_hash.
802 (append_file_to_dir): Use XNEWVEC.
803 (read_filename_string): Likewise. Use XRESIZEVEC too.
804 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
805 (remap_filename): Use XNEWVEC.
806 (struct pchf_entry): Move definition out of struct pchf_data.
807 (_cpp_save_file_entries): Use XCNEWVAR.
808 (_cpp_read_file_entries): Use XNEWVAR.
809 * identifiers.c (alloc_node): Use XOBNEW.
810 * init.c (cpp_create_reader): Use XCNEW.
811 (cpp_init_builtins): Cast of b->value to enum builtin_type.
812 (read_original_directory): Cast return value of alloca.
813 * lex.c (add_line_note): Use XRESIZEVEC.
814 (warn_about_normalization): Use XNEWVEC.
815 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
816 (new_buff): Use XNEWVEC.
817 * line-map.c (linemap_add): Use XRESIZEVEC.
818 * macro.c (builtin_macro): Cast return value of alloca.
819 (paste_tokens): Likewise.
820 (expand_arg): Use XNEWVEC and XRESIZEVEC.
821 (_cpp_save_parameter): Use XRESIZEVEC.
822 (create_iso_definition): Cast allocated storage to proper type.
823 (_cpp_create_definition): Likewise.
824 (cpp_macro_definition): Use XRESIZEVEC.
825 * makedepend.c (add_clm): Use XNEW.
827 * mkdeps.c (munge): Use XNEWVEC.
828 (deps_init): Use XCNEW.
829 (deps_add_target): Use XRESIZEVEC.
830 (deps_add_default_target): Cast return value of alloca.
831 (deps_add_dep): Use XRESIZEVEC.
832 (deps_add_vpath): Likewise. Use XNEWVEC too.
833 (deps_restore): Likewise.
834 * pch.c (save_idents): Use XNEW and XNEWVEC.
835 (cpp_save_state): Use XNEW.
836 (count_defs): Cast return value of htab_find.
837 (write_defs): Likewise.
838 (cpp_write_pch_deps): Use XNEWVEC.
839 (collect_ht_nodes): Use XRESIZEVEC.
840 (cpp_valid_state): Use XNEWVEC.
841 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
842 * symtab.c (ht_create): Use XCNEW.
843 (ht_lookup_with_hash): Cast return value of obstack_copy0.
844 (ht_expand): Use XCNEWVEC.
845 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
846 (bool): Do not define if __cplusplus.
848 2005-05-12 Zack Weinberg <zack@codesourcery.com>
850 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
851 (do_sccs): Delete function definition, #define to do_ident.
852 (do_ident): Don't hardwire directive name.
854 2005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
857 * configure: Regenerate.
859 2005-04-27 Andris Pavenis <pavenis@latnet.lv>
861 * files.c: Include io.h for DJGPP to get prototype of setmode.
863 2005-04-19 Per Bothner <per@bothner.com>
865 PR preprocessor/20907
866 * line-map.c (linemap_line_start): Fix bug when we need to increse
867 column_bits but can re-use the current line_map.
869 2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
871 * system.h (fopen, fdopen, freopen): Define these to the unlocked
874 2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
876 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
877 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
878 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
879 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
881 (fwrite_unlocked): Fix prototype.
883 * configure, config.in: Regenerate.
885 2005-04-05 Jakub Jelinek <jakub@redhat.com>
887 PR preprocessor/19475
888 * macro.c (create_iso_definition): For < ISO C99, don't
889 pedwarn if there is no whitespace between macro name and its
890 replacement, but the replacement starts with a basic character
893 2005-03-28 Andreas Jaeger <aj@suse.de>
895 * lex.c (warn_about_normalization): Cast field width to int to
898 2005-03-19 Joseph S. Myers <joseph@codesourcery.com>
900 * configure.ac: Consistently use solaris2.1[0-9]* instead of
902 * configure: Regenerate.
904 2005-03-15 Geoffrey Keating <geoffk@apple.com>
906 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
907 UCN rather than printing an error.
909 2005-03-14 Geoffrey Keating <geoffk@apple.com>
911 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
913 2005-03-14 Geoffrey Keating <geoffk@apple.com>
915 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
916 * charset.c: Update for new format of ucnid.h.
917 (ucn_valid_in_identifier): Update for new format of ucnid.h.
918 Add NST parameter, and update it; update callers.
919 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
921 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
922 * internal.h (struct normalize_state): New.
923 (INITIAL_NORMALIZE_STATE): New.
924 (NORMALIZE_STATE_RESULT): New.
925 (NORMALIZE_STATE_UPDATE_IDNUM): New.
926 (_cpp_valid_ucn): New.
927 * lex.c (warn_about_normalization): New.
928 (forms_identifier_p): Add normalize_state parameter, update callers.
929 (lex_identifier): Add normalize_state parameter, update callers. Keep
931 (lex_number): Likewise.
932 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
933 it with warn_about_normalization.
937 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
938 comments about obsolete version of C++.
939 * include/cpplib.h (enum cpp_normalize_level): New.
940 (struct cpp_options): Add warn_normalize field.
942 2005-03-11 Geoffrey Keating <geoffk@apple.com>
944 * directives.c (glue_header_name): Update call to cpp_spell_token.
945 * internal.h (_cpp_interpret_identifier): New.
946 * charset.c (_cpp_interpret_identifier): New.
947 (_cpp_valid_ucn): Allow UCN version of '$'.
948 * lex.c (lex_identifier): Add extra parameter to indicate if initial
949 character was '$' or '\'. Support identifiers with UCNs.
950 (forms_identifier_p): Allow UCNs.
951 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
953 (cpp_spell_token): Add FORSTRING parameter. Use it.
954 (cpp_token_as_text): Update call to cpp_spell_token.
955 (cpp_output_token): Write UCNs back out.
956 (stringify_arg): Update call to cpp_spell_token.
957 (paste_tokens): Likewise.
958 (cpp_macro_definition): Likewise.
959 * macro.c (stringify_arg): Likewise.
960 (paste_tokens): Likewise.
961 (cpp_macro_definition): Likewise.
962 * include/cpplib.h: Add parameter to cpp_spell_token.
964 2005-03-04 Jakub Jelinek <jakub@redhat.com>
968 * macro.c (replace_args, cpp_get_token): Copy whole
969 cpp_token_u instead of just cpp_string field from it.
971 2005-02-28 Devang Patel <dpatel@apple.com>
973 * directives.c (do_line): Save sysp early before line table is
976 2005-02-20 Zack Weinberg <zack@codesourcery.com>
979 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
980 (cpp_host_to_exec_charset): New function.
981 * include/cpplib.h: Declare cpp_host_to_exec_charset.
983 2005-02-19 Devang Patel <dpatel@apple.com>
985 * charset.c (_cpp_convert_input): Check '\r' before inserting
988 2005-02-15 Eric Christopher <echristo@redhat.com>
990 PR preprocessor/19077
991 * macro.c (cpp_macro_definition): Move handling of whitespace
992 to PREV_WHITE conditional. Remove overloading of len
995 2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
997 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
998 traditional.c: Update copyright.
1000 2005-02-14 Paolo Bonzini <bonzini@gnu.org>
1003 * configure.ac: Check for declaration of basename and getopt.
1004 * config.in: Regenerate.
1005 * configure: Regenerate.
1006 * internal.h (ustrcspn): New.
1007 * macro.c (create_iso_definition): Fix allocation of memory.
1008 (padding_token): Add cast to remove const-ness.
1009 * pch.c (cpp_read_state): Use ustrcspn.
1011 2005-02-08 Mike Stump <mrs@apple.com>
1013 * files.c (pchf_adder): Remove.
1014 (struct pchf_adder_info): Likewise.
1015 (_cpp_save_file_entries): Write out all files so that #import works.
1017 2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
1019 * configure: Regenerate.
1021 2005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
1023 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
1025 * include/cpplib.h: Also update copyright years.
1027 2005-01-03 Geoffrey Keating <geoffk@apple.com>
1029 * files.c (_cpp_find_file): Add files found by search_path_exhausted
1030 to the list of all files.
1032 2005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
1034 * internal.h: Update references to Cpp lib filenames.
1035 * directives.c: Likewise.
1037 * macro.c: Likewise.
1038 * traditional.c: Likewise.
1040 2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
1042 PR preprocessor/15167
1043 * files.c (destroy_cpp_file): New function.
1044 (should_stack_file): Make a new file if the
1045 compared file is still stacked.
1047 2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
1049 PR preprocessor/17610
1050 * directives.c (do_include_common): Error out if an empty filename
1051 is given for #include (or #include_next or #import).
1053 2004-11-27 Roger Sayle <roger@eyesopen.com>
1054 Zack Weinberg <zack@codesourcery.com>
1056 * internal.h: Replace all uses of uchar with unsigned char.
1057 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
1058 with !IN_GCC, so uchar is only defined whilst building libcpp.
1060 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
1062 * aclocal.m4: Regenerate.
1064 2004-11-24 Roger Sayle <roger@eyesopen.com>
1066 PR preprocessor/15824
1067 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
1068 directly, instead of the non-existant "system.h" and "ansidecl.h".
1069 * configure: Regenerate.
1071 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
1072 Joseph Myers <joseph@codesourcery.com>
1074 * internal.h (struct lexer_state): Add in_deferred_pragma.
1075 * directives.c (struct pragma_entry): Add allow_expansion.
1076 (insert_pragma_entry): Take allow_expansion flag.
1077 (register_pragma): Likewise.
1078 (cpp_register_pragma): Likewise.
1079 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
1080 (do_pragma): Honor allow_expansion.
1081 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
1082 * include/cpplib.h (cpp_register_pragma): Update prototype.
1084 2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
1085 Mark Mitchell <mark@codesourcery.com>
1087 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
1088 need_64bit_hwint=yes.
1089 * configure: Regenerate.
1091 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
1093 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
1095 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
1096 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
1097 Remove local srcdir path from generated file.
1099 2004-11-04 Zack Weinberg <zack@codesourcery.com>
1100 Gerald Pfeifer <gerald@pfeifer.com>
1102 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
1105 2004-10-27 Zack Weinberg <zack@codesourcery.com>
1108 * directives.c (do_pragma): Do not defer pragmas which are unknown.
1109 (cpp_handle_deferred_pragma): Add cast to silence warning.
1111 2004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
1113 * errors.c (_cpp_begin_message): Print "error: " for errors.
1115 2004-10-10 Andreas Jaeger <aj@suse.de>
1117 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
1118 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
1120 2004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
1122 * pch.c (cpp_write_pch_state): Remove variable z as it is not
1124 (cpp_read_state): Remove unused variables, m, d and mac_count.
1126 2004-09-29 Per Bothner <per@bothner.com>
1128 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
1129 cb.line_change. Otherwise do_pragma will call the line_change
1130 call-back with a meaningless line number.
1132 2004-09-24 Zack Weinberg <zack@codesourcery.com>
1134 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
1135 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
1136 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
1137 * aclocal.m4, configure: Regenerate.
1138 * init.c: Include localedir.h.
1139 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
1141 (.c.o): Use $(ALL_CFLAGS).
1142 (localedir.h, localedir.hs): New rules.
1143 (clean): Use rm -rf to remove directories.
1144 (distclean): Also delete localedir.h and localedir.hs.
1145 (init.o): Update dependencies.
1147 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
1149 * Makefile.in (aclocal.m4): Update dependencies.
1150 * configure.ac (AC_CONFIG_MACRO_DIR): New.
1151 * aclocal.m4, configure: Regenerate.
1153 2004-09-17 Zack Weinberg <zack@codesourcery.com>
1155 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
1156 (_cpp_convert_input, _cpp_default_encoding): Add comments.
1157 Some other comments in this file also tweaked.
1159 * directives.c (do_pragma): Save current buffer position
1160 before lexing the pragma keywords; don't call
1161 _cpp_backup_tokens in the defer_pragmas case.
1163 2004-09-15 Per Bothner <per@bothner.com>
1165 * include/line-map.h (line_map_start): Add parameter names so
1166 preceding comment makes sense.
1167 (linemap_add): Remove from comment mention of non-existing parameter.
1169 2004-09-09 Matt Austern <austern@apple.com>
1170 Zack Weinberg <zack@codesourcery.com>
1172 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
1173 prefixes throughout. Add entry for PRAGMA. Remove
1174 unnecessary "= 0" from EQ.
1175 (enum cpp_ttype): Adjust OP and TK definitions to restore
1176 prefixes, via token-paste.
1177 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
1178 Change from #defines to additional cpp_ttype enumerators.
1179 (struct cpp_options): Add defer_pragmas.
1180 (cpp_handle_deferred_pragma): Prototype new interface.
1182 * internal.h (struct cpp_reader): Add directive_result.
1183 * directives.c (struct pragma_entry): Add is_internal field;
1184 give boolean fields type bool.
1185 (start_directive): Initialize pfile->directive_result.type.
1186 (_cpp_do__Pragma): Likewise.
1187 (run_directive): Do not crash if pfile->buffer->prev is NULL.
1188 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
1190 (register_pragma): New static function, bulk of former
1191 cpp_register_pragma here; add 'internal' argument, pass along
1192 to insert_pragma_entry.
1193 (cpp_register_pragma): Now a wrapper around register_pragma which
1194 always passes false for 'internal' argument.
1195 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
1196 true for 'internal'.
1197 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
1198 an internal pragma, save text till the end of the line as a CPP_PRAGMA
1199 token instead of executing the pragma.
1200 (cpp_handle_deferred_pragma): New interface.
1201 * lex.c (token_spellings): Adjust OP and TK definitions to
1202 match changes to cpplib.h.
1203 (_cpp_lex_token): Check for a directive-result token and
1204 return it if present.
1205 (cpp_token_val_index): Handle CPP_PRAGMA.
1206 * macro.c (cpp_builtin_macro_text): Correct comment.
1207 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
1209 2004-09-06 Serge Belyshev <belyshev@lubercy.com>
1211 PR preprocessor/14699
1212 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
1213 from size_t to double.
1215 2004-08-28 Andreas Schwab <schwab@suse.de>
1216 Andreas Jaeger <aj@suse.de>
1218 * configure.ac: Set PACKAGE correctly.
1219 * configure: Regenerated.
1221 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
1223 * Makefile.in: Add back top_builddir.
1225 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
1227 * configure.ac: Replace Automake macro invocations
1228 with manual Autoconf checks and substitutions.
1229 * configure: Regenerate.
1230 * aclocal.m4: Regenerate.
1231 * config.in: Regenerate.
1232 * Makefile.am: Removed.
1233 * Makefile.in: Heavy simplification and reorganization.
1235 2004-08-09 Mark Mitchell <mark@codesourcery.com>
1237 * configure.ac (arm*-*-eabi*): New target.
1238 (arm*-*-symbianelf*): Likewise.
1239 * configure: Regenerated.
1241 2004-07-24 Bernardo Innocenti <bernie@develer.com>
1243 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
1244 * directives.c: Use XNEW-family macros from libiberty.
1246 * macro.c: Likewise.
1247 * cpplib.h (cpp_deps_style): Export enum with name.
1249 2004-07-23 Matthias Klose <doko@debian.org>
1251 * init.c (init_library): Use PACKAGE for the text domain.
1253 2004-07-16 Andris Pavenis <pavenis@latnet.lv>
1255 PR preprocessor/16366
1256 * internal.h (struct cpp_reader): New field dir_hash.
1257 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
1258 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
1260 2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
1262 PR preprocessor/16192
1263 PR preprocessor/15913
1264 PR preprocessor/15572
1265 * expr.c (_cpp_parse_expr): Handle remaining cases where an
1266 expression is missing.
1267 * init.c (post_options): Traditional cpp doesn't do // comments.
1269 2004-06-30 Per Bothner <per@bothner.com>
1271 * include/line-map.h (fileline): Remove old typedef.
1272 * internal.h (struct cpp_reader): Use source_location typedef instead.
1274 2004-06-26 Zack Weinberg <zack@codesourcery.com>
1276 Partially revert patch of 2004-06-05.
1277 * files.c (search_cache): Remove pfile argument. Don't check
1278 for file that would be found by "" or <> search here...
1279 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
1280 Do not apply directory-of-current-file correction to files
1281 found by this check. Rearrange code slightly.
1283 2004-06-21 Geoffrey Keating <geoffk@apple.com>
1285 * files.c (should_stack_file): Correct swapped parameters to call
1287 * pch.c (cpp_valid_state): Handle -fpreprocessed.
1289 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
1291 * Makefile.in: Regenerate with automake 1.8.5.
1292 * aclocal.m4: Likewise.
1293 * configure: Regenerate.
1295 2004-06-11 Zack Weinberg <zack@codesourcery.com>
1297 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
1298 * configure, config.in: Regenerate.
1299 * system.h: Unconditionally define bool as unsigned char,
1300 BOOL_BITFIELD as unsigned int.
1301 * .cvsignore: New file.
1303 2004-06-09 Geoffrey Keating <geoffk@apple.com>
1305 * traditional.c (push_replacement_text): Set macro->traditional.
1306 (save_replacement_text): Likewise.
1307 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
1308 (struct save_macro_item): Delete.
1309 (struct save_macro_data): Use a character array not the previous
1311 (save_macros): Save macro as text not as internal structures.
1312 (cpp_prepare_state): Update for changes to save_macro_data.
1313 (cpp_read_state): Don't read macros defined in PCH. Restore
1315 * macro.c (create_iso_definition): Honour alloc_subobject.
1316 Clear traditional flag.
1317 (_cpp_create_definition): Honour alloc_subobject.
1318 * lex.c (cpp_token_val_index): New.
1319 * internal.h: Include cpp-id-data.h.
1320 (uchar): Move definition to cpp-id-data.h.
1322 (cpp_macro): Likewise.
1323 * directives.c (struct answer): Move to cpp-id-data.h.
1324 (do_assert): Honour alloc_subobject.
1326 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
1327 * include/cpplib.h (struct cpp_string): Add GTY marker.
1328 (enum cpp_token_fld_kind): New.
1329 (struct cpp_token): Add GTY markers.
1330 (cpp_token_val_index): Prototype.
1331 (CPP_HASHNODE_VALUE_IDX): New.
1332 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
1333 * include/cpp-id-data.h: New file.
1335 2004-06-09 Paolo Bonzini <bonzini@gnu.org>
1337 * Makefile.am (all-local): New.
1338 * Makefile.in: Regenerate.
1340 2004-06-06 Roger Sayle <roger@eyesopen.com>
1342 * Makefile.am (LIBICONV): Declare.
1343 (makedepend_LDADD): Use LIBICONV.
1344 * Makefile.in: Regenerate.
1346 2004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
1348 * Makefile.am (LIBINTL): Declare
1349 (makedepend_LDADD): Use LIBINTL.
1350 * Makefile.in: Regenerate.
1352 2004-06-05 Zack Weinberg <zack@codesourcery.com>
1354 * Makefile.am: Add makedepend.
1355 * Makefile.in, aclocal.m4: Regenerate.
1356 * charset.c: Insert a space to avoid a warning.
1357 * directives.c: Include mkdeps.h.
1358 (_cpp_handle_directive): Reenable macro expander if appropriate.
1359 (undefine_macros): Inline body of _cpp_free_definition for speed.
1360 Do not call undef callback or _cpp_warn_if_unused_macro.
1361 (cpp_get_deps): New interface.
1362 * files.c (search_cache): Add pfile argument. Check for file
1363 that would be found by "" or <> search here...
1364 (_cpp_find_file): ...not here. Correct recorded start_dir of
1365 files found by directory-of-current-file search that would be
1366 found by "" or <> search.
1367 * init.c (cpp_add_dependency_target): Delete.
1368 * internal.h (struct lexer_state): Add discarding_output flag.
1369 * lex.c (lex_identifier): Compute hash function while scanning.
1370 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
1372 * makedepend.c: New file.
1373 * mkdeps.c (struct deps): Add vpath vector.
1374 (apply_vpath, deps_add_vpath): New function.
1375 (deps_free): Free vpath vector.
1376 (deps_add_dep, deps_add_target): Use apply_vpath.
1377 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
1378 (ht_lookup_with_hash): New function.
1379 * cpplib.h, mkdeps.h: Update prototypes.
1380 * symtab.h: Update prototypes.
1381 (HT_HASHSTEP, HT_FINISH): New macros.
1383 2004-05-29 Geoffrey Keating <geoffk@apple.com>
1385 * symtab.c (ht_create): Set entries_owned.
1386 (ht_destroy): Honour entries_owned.
1387 (ht_expand): Likewise.
1389 * include/symtab.h (struct ht): New field 'entries_owned'
1390 (ht_load): New prototype.
1392 2004-05-26 Paolo Bonzini <bonzini@gnu.org>
1395 * configure.ac: Fix m4 quoting when picking
1396 the size of HOST_WIDE_INT.
1397 * configure: Regenerate.
1399 2004-05-25 Paolo Bonzini <bonzini@gnu.org>
1401 * Makefile.am: the correct directory for
1402 gettext include files is given by @INCINTL@.
1403 * Makefile.in: Regenerate.
1405 2004-05-24 Paolo Bonzini <bonzini@gnu.org>
1407 * system.h [!ENABLE_NLS]: dgettext takes two
1410 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
1412 Moved libcpp from the gcc subdirectory to the toplevel.
1413 * Makefile.am: New file.
1414 * Makefile.in: Regenerate.
1415 * configure.ac: New file.
1416 * configure: Regenerate.
1417 * config.in: Regenerate.
1418 * charset.c: Moved from gcc/cppcharset.c. Add note about
1419 brokenness of input charset detection. Adjust for change
1420 in name of cppucnid.h.
1421 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
1422 * expr.c: Moved from gcc/cppexp.c.
1423 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
1424 Remove #define of O_BINARY, it is in system.h.
1425 * identifiers.c: Moved from gcc/cpphash.c.
1426 * internal.h: Moved from gcc/cpphash.h. Change header
1427 guard name. All other files adjusted to match name change.
1428 * init.c: Moved from gcc/cppinit.c.
1429 (init_library) [ENABLE_NLS]: Call bindtextdomain.
1430 * lex.c: Moved from gcc/cpplex.c.
1431 * directives.c: Moved from gcc/cpplib.c.
1432 * macro.c: Moved from gcc/cppmacro.c.
1433 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
1434 * traditional.c: Moved from gcc/cpptrad.c.
1435 * ucnid.h: Moved from gcc/cppucnid.h. Change header
1437 * ucnid.pl: Moved from gcc/cppucnid.pl.
1438 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
1440 * symtab.c: Moved from gcc/hashtable.c.
1441 * line-map.c: Moved from gcc. Do not include intl.h.
1442 * mkdeps.c: Moved from gcc.
1443 * system.h: New file.
1444 * include/cpplib.h: Moved from gcc. Change header guard name.
1445 * include/line-map.h: Moved from gcc. Change header guard name.
1446 * include/mkdeps.h: Moved from gcc. Change header guard name.
1447 * include/symtab.h: Moved from gcc/hashtable.h. Change header