Fix for PR39548
[official-gcc.git] / libcpp / ChangeLog
blobacffe8e39e0d8ceb1525a7ed880f4daf9e1532ac
1 2009-03-18  Jakub Jelinek  <jakub@redhat.com>
3         * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
5 2009-02-21  Joseph Myers  <joseph@codesourcery.com>
7         * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
8         header name.
9         (_cpp_lex_direct): Handle this.
11 2009-02-15  Richard Guenther  <rguenther@suse.de>
13         Revert last change.
15 2009-02-13  Richard Guenther  <rguenther@suse.de>
17         * configure.ac: Enable LFS.
18         * configure: Re-generate.
19         * config.in: Likewise.
21 2009-01-05  Ben Elliston  <bje@au.ibm.com>
23         * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
24         (.po.pox): Likewise.
25         (po/$(PACKAGE).pot): Likewise.
27 2008-12-10  Alexandre Oliva  <aoliva@redhat.com>
29         PR target/37033
30         * pch.c (cpp_valid_state): Improve message for poisoned symbols.
31         Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
33 2008-11-29  Joseph Myers  <joseph@codesourcery.com>
35         * lex.c (cpp_token_len): Use 6 as default length.
37 2008-10-31  Manuel López-Ibáñez  <manu@gcc.gnu.org>
39         * expr.c (struct op): Add location.
40         (_cpp_parse_expr): Propagate locations throught the stack
41         of expressions.
42         (reduce): Likewise.
43         (check_promotion): Use explicit location in errors.
45 2008-10-05  Matthew Gingell  <gingell@adacore.com>
46             Arnaud Charlet  <charlet@adacore.com>
48         * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
49         (cpp_get_comments): New function.
50         * internal.h (struct cpp_reader): Add comments field.
51         * init.c (cpp_destroy): Free comments.
52         * lex.c (store_comment, cpp_get_comments): New functions.
53         (comments): New struct.
54         (save_comment): Store comments in comments struct.
56 2008-09-18  Simon Baldwin  <simonb@google.com>
58         * include/cpplib.h (struct cpp_options): Add new boolean flag
59         warn_builtin_macro_redefined.
60         * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
61         * (struct builtin_operator): Split out from previous struct builtin,
62         enhance extra const correctness.
63         * (struct builtin_macro): Split out from previous struct builtin, add
64         new always_warn_if_redefined flag, enhance const correctness.
65         * (mark_named_operators): Use struct builtin_operator.
66         * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
67         to builtins selectively.
68         * macro.c (warn_of_redefinition): Return false if a builtin macro
69         is not flagged with NODE_WARN.
71 2008-07-31  Jakub Jelinek  <jakub@redhat.com>
73         PR preprocessor/36649
74         * files.c (struct report_missing_guard_data): New type.
75         (report_missing_guard): Put paths into an array instead of printing
76         them right away.  Return 1 rather than 0.
77         (report_missing_guard_cmp): New function.
78         (_cpp_report_missing_guards): Sort and print paths gathered by
79         report_missing_guard callback.
81 2008-07-22  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
83         PR 28079
84         * directives.c (strtolinenum): Handle overflow.
85         (do_line): Give a warning if line number overflowed.
86         (do_linemarker): Update call to strtolinenum.
88 2008-07-21  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
90         * include/line-map.h (linenum_type): New typedef.
91         (struct line_map): Use it.
92         (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
93         (SOURCE_COLUMN): Likewise.
94         * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
95         source_location values in a variable of type linenum_type.
96         * directives.c (struct if_stack): Use linenum_type.
97         (strtoul_for_line): Rename as strtolinenum.
98         (do_line): Use linenum_type.
99         (do_linemarker): Use linenum_type and strtolinenum.
100         (_cpp_do_file_change): Use linenum_t.
101         * line-map.c (linemap_add): Likewise.
102         (linemap_line_start): Likewise.
103         * traditional.c (struct fun_macro): 'line' is a source_location.
104         * errors.c (print_location): Use linenum_type.
105         * directives-only.c (_cpp_preprocess_dir_only): Likewise.
106         * internal.h (CPP_INCREMENT_LINE): Likewise.
107         * lex.c (_cpp_skip_block_comment): Use source_location.
108         
109 2008-07-14  Ben Elliston  <bje@au.ibm.com>
111         * include/cpplib.h (NODE_CONDITIONAL): New.
112         (struct cpp_callbacks): New macro_to_expand field.
113         (struct cpp_hashnode): Adjust size of flags and type fields.
114         (cpp_peek_token): Prototype.
115         * lex.c (cpp_peek_token): New function.
116         (_cpp_temp_token): Protect pre-existing lookaheads.
117         * macro.c (cpp_get_token): Expand any conditional macros.
118         (_cpp_backup_tokens_direct): New.
119         (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
120         (warn_of_redefinition): Silently allow redefined conditional
121         macros.
122         (_cpp_create_definition): Remove the conditional flag when a user
123         defines one of the conditional macros.
124         * internal.h (_cpp_backup_tokens_direct): New prototype.
126 2008-06-13  Andrew Haley  <aph@redhat.com>
128         PR preprocessor/33305
129         * macro.c (replace_args): Print a warning for empty macro
130         arguments in C89 and C++.
132 2008-06-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
134         * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
135         * configure: Regenerate.
137 2008-06-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
139         * Makefile.in (datarootdir): New variable.
141 2008-06-12  H.J. Lu  <hongjiu.lu@intel.com>
143         PR preprocessor/36479
144         * charset.c (cpp_interpret_string_notranslate): Also set
145         narrow_cset_desc.width.
147 2008-06-07  Joseph Myers  <joseph@codesourcery.com>
149         * configure.ac (parisc*64*-*-*): Remove.
150         * configure: Regenerate.
152 2008-05-30  Tom Tromey  <tromey@redhat.com>
154         PR preprocessor/36320:
155         * internal.h (_cpp_parse_expr): Update.
156         * expr.c (_cpp_parse_expr): Add 'is_if' argument.  Update error
157         messages.
158         * directives.c (do_if): Update.
159         (do_elif): Require expression if processing group.
161 2008-05-30  Danny Smith  <dannysmith@users.sourceforge.net>
163         * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
165 2008-05-21  Tom Tromey  <tromey@redhat.com>
167         PR preprocessor/27777:
168         * lex.c (cpp_output_line_to_string): New function.
169         * internal.h (_cpp_begin_message): Don't declare.
170         * errors.c (_cpp_begin_message): Now static.
171         * include/cpplib.h (cpp_output_line_to_string): Declare.
172         * directives.c (do_diagnostic): Rewrote.  Use
173         cpp_output_line_to_string.  Don't use _cpp_begin_message.
175 2008-05-21  Tom Tromey  <tromey@redhat.com>
177         * include/symtab.h (HT_ALLOCED): Remove.
178         (ht_purge): Declare.
179         * symtab.c (DELETED): New define.
180         (ht_lookup): Update comment.
181         (ht_lookup_with_hash): Handle deleted entries.  Remove HT_ALLOCED
182         code.  Use subobject allocator for strings, if it exists.
183         (ht_expand): Handle deleted entries.
184         (ht_forall): Likewise.
185         (ht_purge): New function.
186         (ht_dump_statistics): Print deletion statistics.
188 2008-05-13  Tom Tromey  <tromey@redhat.com>
190         PR preprocessor/22168:
191         * include/cpplib.h (struct cpp_options) <objc>: Update
192         documentation.
193         * expr.c (eval_token): Warn for use of assertions.
194         * directives.c (directive_diagnostics): Warn about extensions.
195         (DEPRECATED): New define.
196         (DIRECTIVE_TABLE): Use it.
198 2008-05-06  Tom Tromey  <tromey@redhat.com>
200         PR preprocessor/35313, PR preprocessor/36088:
201         * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
202         (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
204 2008-05-04  David S. Miller  <davem@davemloft.net>
206         * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
207         * configure: Regenerate.
209 2008-04-22  Daniel Franke  <franke.daniel@gmail.com>
211         * include/cpplib.h (cpp_define_formatted): New.
212         * directives.c (cpp_define_formatted): New.
214 2008-04-21  Tom Tromey  <tromey@redhat.com>
216         PR libcpp/33415:
217         * charset.c (_cpp_convert_input): Add buffer_start argument.
218         Ignore UTF-8 BOM if seen.
219         * internal.h (_cpp_convert_input): Add argument.
220         * files.c (struct _cpp_file) <buffer_start>: New field.
221         (destroy_cpp_file): Free buffer_start, not buffer.
222         (_cpp_pop_file_buffer): Likewise.
223         (read_file_guts): Update.
225 2008-04-18  Kris Van Hees <kris.van.hees@oracle.com>
227         * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
228         * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
229         (struct cpp_options): Added uliterals.
230         (cpp_interpret_string): Update prototype.
231         (cpp_interpret_string_notranslate): Idem.
232         * charset.c (init_iconv_desc): New width member in cset_converter.
233         (cpp_init_iconv): Add support for char{16,32}_cset_desc.
234         (convert_ucn): Idem.
235         (emit_numeric_escape): Idem.
236         (convert_hex): Idem.
237         (convert_oct): Idem.
238         (convert_escape): Idem.
239         (converter_for_type): New function.
240         (cpp_interpret_string): Use converter_for_type, support u and U prefix.
241         (cpp_interpret_string_notranslate): Match changed prototype.
242         (wide_str_to_charconst): Use converter_for_type.
243         (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
244         * directives.c (linemarker_dir): Macro U changed to UC.
245         (parse_include): Idem.
246         (register_pragma_1): Idem.
247         (restore_registered_pragmas): Idem.
248         (get__Pragma_string): Support CPP_STRING{16,32}.
249         * expr.c (eval_token): Support CPP_CHAR{16,32}.
250         * init.c (struct lang_flags): Added uliterals.
251         (lang_defaults): Idem.
252         * internal.h (struct cset_converter) <width>: New field.
253         (struct cpp_reader) <char16_cset_desc>: Idem.
254         (struct cpp_reader) <char32_cset_desc>: Idem.
255         * lex.c (digraph_spellings): Macro U changed to UC.
256         (OP, TK): Idem.
257         (lex_string): Add support for u'...', U'...', u"..." and U"...".
258         (_cpp_lex_direct): Idem.
259         * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
260         (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
262 2008-04-18  Paolo Bonzini  <bonzini@gnu.org>
264         PR bootstrap/35457
265         * aclocal.m4: Regenerate.
266         * configure: Regenerate.
268 2008-04-17  Tom Tromey  <tromey@redhat.com>
270         PR libcpp/34866:
271         * errors.c (cpp_error): Don't reference a token before the start
272         of the current run.
274 2008-04-16  Tom Tromey  <tromey@redhat.com>
276         * Makefile.in (TAGS_SOURCES): New variable.
277         (TAGS): New target.
279 2008-04-11  Kaz Kojima  <kkojima@gcc.gnu.org>
281         * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
282         and shbe-*-*.
283         * configure: Rebuilt.
285 2008-04-02  Joseph Myers  <joseph@codesourcery.com>
287         * include/cpplib.h (struct cpp_callbacks): Add used_define,
288         used_undef and before_define.
289         (NODE_USED): Define.
290         * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
291         do_ifndef, cpp_pop_definition): Handle new flag and use new
292         callbacks.
293         * expr.c (parse_defined): Handle new flag and use new callbacks.
294         * macro.c (enter_macro_context, _cpp_free_definition): Handle new
295         flag and use new callbacks.
297 2008-04-01  Jakub Jelinek  <jakub@redhat.com>
299         PR pch/13675
300         * files.c (struct _cpp_file): Remove pch field.
301         (pch_open_file): Don't set file->pch, just file->pchname.
302         (should_stack_file): After pfile->cb.read_pch call
303         free pchname and clear pchname, don't close file->fd.
304         Test file->pchname instead of file->pch.  Don't close fd after cb.
305         (_cpp_stack_include): Test file->pchname instead of file->pch.
307 2008-03-28  Tom Tromey  <tromey@redhat.com>
309         * Makefile.in (POSTCOMPILE): New variable.
310         (.c.o): Use it.
312 2008-03-13  Tom Tromey  <tromey@redhat.com>
314         PR libcpp/35322:
315         * directives.c (destringize_and_run): Set pfile->directive.
317 2008-03-06  Markus Milleder  <markus.milleder@generali.at>
319         PR preprocessor/35458
320         * mkdeps.c (munge): Quote '#' with a '\'.
322 2008-02-27  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
324         PR preprocessor/35379
325         * mkdeps.c (deps_write): Ensure the first target always appears
326         in the first column, without leading backslash newline.  Avoid
327         some more extra whitespace.
329 2008-02-25  Thiemo Seufer <ths@mips.com>
331         * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
333 2008-02-19  Tom Tromey  <tromey@redhat.com>
335         * traditional.c (lex_identifier): Use CPP_HASHNODE.
336         * lex.c (lex_identifier): Use CPP_HASHNODE.
337         * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
338         do-while.
339         * identifiers.c (alloc_node): Change return type.
340         (_cpp_init_hashtable): Don't cast 'alloc_node'.
341         (proxy_assertion_broken): New declaration.
342         (cpp_forall_identifiers): Move comment.
343         * line-map.c (linemap_add): Comment fix.
344         (linemap_line_start): Indentation fix.
346 2008-01-25  Jakub Jelinek  <jakub@redhat.com>
348         PR preprocessor/34692
349         * macro.c (collect_args): Add pragma_buff argument.  Push
350         CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
351         than into arguments.  Reset prevent_expansion and parsing_args
352         state at CPP_PRAGMA_EOL/CPP_EOF.
353         (funlike_invocation_p): Add pragma_buff argument, pass it through
354         to collect_args.
355         (enter_macro_context): Add result argument.  Adjust
356         funlike_invocation_p caller.  Emit all deferred pragma tokens
357         gathered during collect_args before the expansion, add a padding
358         token.  Return 2 instead of 1 if any pragma tokens were prepended.
359         (cpp_get_token): If enter_macro_context returns 2, don't return
360         a padding token, instead cycle to grab CPP_PRAGMA token.
361         * directives.c (_cpp_handle_directive): If was_parsing_args
362         in deferred pragma, leave parsing_args and prevent_expansion as is.
364 2008-01-22  Tom Tromey  <tromey@redhat.com>
366         PR c++/34859
367         * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
368         __STDC_CONSTANT_MACROS.
370 2008-01-07  Fred Fish  <fnf@specifix.com>
372         PR preprocessor/30363
373         * traditional.c (replace_args_and_push): Add local variable
374         cxtquote, calculate the replacement text size assuming a 
375         worst case of every input character quoted with backslash,
376         and properly handle output quoting of quote characters in
377         actual arguments used in function-like macros.
379 2008-01-03  Tom Tromey  <tromey@redhat.com>
381         PR preprocessor/34602
382         * directives.c (do_line): Don't try to spell EOF token.
383         (do_linemarker): Add comment.
385 2007-12-11  DJ Delorie  <dj@redhat.com>
387         * charset.c (convert_using_iconv): Close out any shift states,
388         returning to the initial state.
390 2007-12-06  Tom Tromey  <tromey@redhat.com>
392         PR c/29172
393         * internal.h (struct cpp_reader) <file_hash_entries>: Changed
394         type.
395         <file_hash_entries_allocated, file_hash_entries_used>: Removed.
396         * files.c (FILE_HASH_POOL_SIZE): New macro.
397         (struct file_hash_entry_pool): New.
398         (destroy_all_cpp_files): New function.
399         (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
400         (new_file_hash_entry): Update.
401         (free_file_hash_entries): New function.
402         (_cpp_cleanup_files): Call free_file_hash_entries and
403         destroy_all_cpp_files.
404         (cpp_clear_file_cache): New function.
405         * include/cpplib.h (cpp_clear_file_cache): Declare.
407 2007-12-03  Tom Tromey  <tromey@redhat.com>
409         PR preprocessor/34288
410         * configure.ac, config.in: Rebuilt.
411         * configure.ac: Check for ssize_t.
413 2007-11-30  Tom Tromey  <tromey@redhat.com>
415         PR preprocessor/32868
416         * macro.c (_cpp_create_definition): Special case
417         __STDC_FORMAT_MACROS.
419 2007-11-16  Michael Matz  <matz@suse.de>
421         * files.c (search_path_head): Fix check for absolute paths.
423 2007-11-11  Tom Tromey  <tromey@redhat.com>
425         PR c++/17557
426         * include/cpplib.h (cpp_included_before): Declare.
427         * files.c (struct file_hash_entry) <location>: New field.
428         (_cpp_find_file): Initialize new field.
429         (make_cpp_dir): Likewise.
430         (cpp_included_before): New function.
432 2007-11-01  Tom Tromey  <tromey@redhat.com>
434         PR preprocessor/30805
435         * macro.c (paste_tokens): Handle padding token.
436         (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
438 2007-10-31  Tom Tromey  <tromey@redhat.com>
440         PR preprocessor/30786
441         * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
442         * directives.c (_cpp_do__Pragma): Return error status.
443         * internal.h (_cpp_do__Pragma): Update.
444         * directives.c (get__Pragma_string): Back up if EOF seen.
446 2007-09-06  Tom Tromey  <tromey@redhat.com>
448         * internal.h (struct cpp_reader) <invocation_location>: New
449         field.
450         (struct cpp_reader) <set_invocation_location>: Likewise.
451         * init.c (cpp_set_line_map): New function.
452         * line-map.c (linemap_add): Use linemap's allocator.
453         * include/line-map.h (GTY): Define.
454         (line_map_realloc): New typedef.
455         (struct line_map): Mark with GTY.
456         (struct line_maps): Likewise.
457         (struct line_maps) <maps>: Likewise.
458         (struct line_maps) <reallocator>: New field.
459         * include/symtab.h (GTY): Conditionally define.
460         * include/cpplib.h (cpp_set_line_map): Declare.
461         (cpp_get_token_with_location): Declare.
462         * macro.c (cpp_get_token): Set invocation_location on the reader.
463         (cpp_get_token_with_location): New function.
465 2007-08-30  Chao-ying Fu  <fu@mips.com>
467         * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
468         ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
469         (cpp_classify_number): Support decimal fixed-point constants without
470         exponents.
471         Warn about fixed-point constants when -pedantic.
472         * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
473         comments to support fixed-point values.
474         (CPP_N_FRACT, CPP_N_ACCUM): Define.
476 2007-08-18  Tom Tromey  <tromey@redhat.com>
478         PR preprocessor/32974
479         * directives.c (parse_include): Don't check for EOL when
480         processing #pragma dependency.
482 2007-07-30  Ollie Wild  <aaw@google.com>
484         * directives-only.c: New file.
485         * internal.h (struct _cpp_dir_only_callbacks): New.
486         (_cpp_preprocess_dir_only): New function.
487         * directives.c (_cpp_handle_directive): Check directives_only before
488         disabling execution of indented directives.
489         * files.c (_cpp_stack_file): Add directives_only check.
490         * include/cpplib.h (struct cpp_options): Add directives_only.
491         (cpp_init_special_builtins): New function.
492         * init.c (cpp_init_special_builtins): New function.
493         (cpp_init_builtins): Move builtin_array initialization to
494         cpp_init_special_builtins.
495         (post_options): Check directives_only before setting
496         pfile->state.prevent_expansion = 1.
497         * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
498         is expanded inside a directive while -fdirectives-only is enabled.
499         * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
500         (libcpp_a_SOURCES): Add directives-only.c.
502 2007-07-04  Uros Bizjak  <ubizjak@gmail.com>
504         * traditional.c (_cpp_scan_out_logical_line): Initialize
505         fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
506         fmacro.args to prevent 'may be used uninitialized' warning.
508 2007-07-03  Uros Bizjak  <ubizjak@gmail.com>
510         * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
511         Add new constants.
512         * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
513         suffixes.  Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
514         for 'q' or 'Q' suffixes.
516 2007-06-17  Danny Smith  <dannysmith@users.sourceforge.net
518         * files.c (open_file): Correct typo.
520 2007-06-16  Vladimir Prus  <vladimir@codesourcery.com>
522         * files.c (open_file): Prevent the call
523         for stat from overwriting errno.
525 2007-06-09  Vladimir Prus  <vladimir@codesourcery.com>
527         * files.c (open_file): Account for the
528         fact that on windows, opening a directory gives
529         EACCES.
531 2007-06-05  Joerg Wunsch  <j.gnu@uriah.heep.sax.de>
533         PR preprocessor/23479
534         * expr.c (cpp_classify_number): Implement 0b-prefixed binary
535         integer constants.
536         (append_digit): Likewise.
537         * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
538         binary integer constants.
540 2007-05-31  Dave Korn  <dave.korn@artimi.com>
542         PR preprocessor/14331
543         * lex.c (_cpp_get_fresh_line):  Don't warn if no newline at EOF.
545 2007-05-24  Ollie Wild  <aaw@google.com>
547         * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
548         * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
549         (cpp_write_pch_state): Save __COUNTER__ state.
550         (cpp_valid_state): Check valid __COUNTER__ state.
551         (cpp_read_state): Read new __COUNTER__ state.
552         * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
553         * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
554         * internal.h (struct cpp_reader): Add counter member.
556 2007-05-23  Simon Martin  <simartin@users.sourceforge.net>
558         PR preprocessor/20077
559         * macro.c (create_iso_definition): Fixed the method to determine
560         whether the token-pasting operator appears at the beginning or the end
561         of a macro.
563 2007-05-21  Ian Lance Taylor  <iant@google.com>
565         * internal.h (struct cpp_reader): Add new fields:
566         nonexistent_file_hash and nonexistent_file_ob.
567         * files.c: Include "obstack.h".
568         (find_file_in_dir): Before trying to open the file, look up the
569         path name in the hash table of nonexistent files.  After failing
570         to open the file, add the path name to the hash table.
571         (_cpp_find_file): Cache the results of looking up the file name
572         starting with the quote and bracket chain heads, if we can.
573         (nonexistent_file_hash_eq): New static function.
574         (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
575         pfile->nonexistent_file_ob.
576         (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
577         pfile->nonexistent_file_ob.
579 2007-05-14  Janis Johnson  <janis187@us.ibm.com>
581         * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
583         PR c/31924
584         * expr.c (interpret_float_suffix): Check for invalid suffix.
586 2007-05-02  Eric Christopher  <echristo@apple.com>
588         * expr.c (num_div_op): Don't overflow if the result is
589         zero.
591 2007-05-02  Tom Tromey  <tromey@redhat.com>
593         PR preprocessor/28709
594         * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
596 2007-03-30  Michael Meissner  <michael.meissner@amd.com>
598         * directives.c (lex_macro_node_from_str): Fix alloca call to be
599         type correct.
601 2007-03-30  Richard Henderson  <rth@redhat.com>
603         * directives.c (lex_macro_node_from_str): New.
604         (cpp_push_definition, cpp_pop_definition): New.
605         * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
607 2007-03-01  Brooks Moses  <brooks.moses@codesourcery.com>
609         * Makefile.in: Add dummy install-pdf target.
611 2007-01-30  Tom Tromey  <tromey@redhat.com>
613         PR preprocessor/30468
614         * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
615         './'.
617 2007-01-30  Tom Tromey  <tromey@redhat.com>
619         PR preprocessor/29966
620         * macro.c (lex_expansion_token): Save and restore cpp_reader's
621         cur_token.
622         (_cpp_create_definition): Don't restore cur_token here.
623         * lex.c (_cpp_lex_token): Added assertion.
625 2007-01-27  Tom Tromey  <tromey@redhat.com>
627         * configure: Rebuilt.
629 2007-01-12  Tom Tromey  <tromey@redhat.com>
631         PR preprocessor/28227
632         * directives.c (lex_macro_node): Added 'is_def_or_undef'
633         argument.
634         (do_define): Update.
635         (do_undef): Update.
636         (do_ifdef): Update.
637         (do_ifndef): Update.
639 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
641         * configure: Regenerate.
643 2007-01-11  Paolo Bonzini  <bonzini@gnu.org>
645         * configure: Regenerate.
647 2007-01-04  Tom Tromey  <tromey@redhat.com>
649         PR preprocessor/28165
650         * internal.h (cpp_in_primary_file): New function.
651         * directives.c (do_include_next): Use cpp_in_primary_file.
652         (do_pragma_once): Likewise.
653         (do_pragma_system_header): Likewise.
655 2006-12-29  Ian Lance Taylor  <iant@google.com>
657         * lex.c (_cpp_clean_line): Add uses of __builtin_expect.  Don't
658         look backward at the end of the line unless we saw a backslash.
660 2006-12-29  Jakub Jelinek  <jakub@redhat.com>
662         PR preprocessor/29612
663         * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
664         only when new_sysp is non-zero.
666 2006-12-28  Tom Tromey  <tromey@redhat.com>
668         PR preprocessor/30001
669         * charset.c (_cpp_convert_input): Check that to.len is greater
670         than zero.
672 2006-11-20  Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
674         * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
675         * configure: Rebuilt.
677 2006-11-01      Douglas Gregor <doug.gregor@gmail.com>
679         * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
680         for experimental C++0x mode.
681         * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
682         adopted the preprocessor changes introduced in C99.
684 2006-10-29  Joseph Myers  <joseph@codesourcery.com>
686         * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
687         depending on --enable-targets=all.
688         * configure: Regenerate.
690 2006-10-12  Jakub Jelinek  <jakub@redhat.com>
692         PR preprocessor/28709
693         * macro.c (paste_tokens): Do error reporting here, use BUF with the
694         spelled LHS token as opposed to spelling it again.
695         (paste_all_tokens): Don't report errors here, just break on failure.
697 2006-10-10  Brooks Moses  <bmoses@stanford.edu>
699         * Makefile.in: Added empty "pdf" target.
701 2006-09-22  Geoffrey Keating  <geoffk@apple.com>
703         * configure.ac: Make need_64_bit_hwint case for x86-darwin
704         match exactly the glob in gcc/config.gcc.
705         * configure: Regenerate.
707 2006-09-13  Joseph S. Myers  <joseph@codesourcery.com>
709         PR c/28768
710         PR preprocessor/14634
711         * lex.c (lex_string): Pedwarn for unterminated literals.
713 2006-09-08  Eric Christopher  <echristo@apple.com>
715         * configure.ac: Add 64-bit HWI support for i?86-darwin.
717 2006-08-14  Steve Ellcey  <sje@cup.hp.com>
719         PR c++/28288
720         PR c++/14556
721         * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
722         (CPP_LAST_EQ): Change.
723         (CPP_LAST_PUNCTUATOR): Change.
724         * expr.c (cpp_operator): Remove MIN and MAX.
725         (reduce): Remove CPP_MIN and CPP_MAX.
726         (num_binary_op): Ditto.
727         * lex.c (_cpp_lex_direct): Ditto.
728         (cpp_avoid_paste): Remove ? as legal symbol after > or <.
730 2006-06-09  Jakub Jelinek  <jakub@redhat.com>
732         PR preprocessor/27746
733         * directives.c (do_pragma): Handle pragma with valid namespace
734         and invalid name coming from macro expansion.
735         * directives.c (destringize_and_run): Initialize next field in
736         context.
738         PR c/27747
739         PR c++/27748
740         * directives.c (destringize_and_run): Set NO_EXPAND on the
741         tokens.
743         * macro.c (_cpp_backup_tokens): Fix comment typo.
745 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
747         * Makefile.in (CATALOGS): Add po/ prefix.
748         * configure: Regenerated.
750 2006-05-23  Carlos O'Donell  <carlos@codesourcery.com>
752         * Makefile.in: Add install-html target. Add install-html to .PHONY
754 2006-02-17  Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
756         * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
757         * files.c (_cpp_get_file_stat): New function.
758         * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
759         * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
760         * internal.h (_cpp_get_file_stat): Prototype.
761         (struct cpp_buffer): Add timestamp.
763 2006-01-23  Jakub Jelinek  <jakub@redhat.com>
765         PR preprocessor/25717
766         * init.c (cpp_init_builtins): If __STDC__ will not change value
767         between system headers and other sources, define it as a normal
768         macro rather than a builtin.
769         * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
770         cpp_in_system_header condition.
772 2006-01-05  Paolo Bonzini  <bonzini@gnu.org>
774         * Makefile.in: Use -MMD instead of -MD.
776 2006-01-04  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
777             Richard Henderson  <rth@redhat.com>
779         Merge from gomp branch:
780         * directives.c (struct pragma_entry): Add is_deferred.  Add ident
781         entry to value union.
782         (end_directive): Don't eat the line if in_deferred_pragma.
783         (run_directive): Remove pragma hacks.
784         (insert_pragma_entry): Remove.
785         (new_pragma_entry): New.
786         (register_pragma_1): Split out of register_pragma.  Only handle
787         the lookup tree and return the new entry.
788         (cpp_register_pragma): Fill in the pragma entry here.
789         (cpp_register_deferred_pragma): New.
790         (register_pragma_internal): New.
791         (_cpp_init_internal_pragmas): Use register_pragma_internal.
792         (do_pragma): Allow pragma expansion after namespace.  For deferred
793         pragmas, don't slurp the line into a string.
794         (destringize_and_run): Save tokens for deferred pragmas.
795         (cpp_handle_deferred_pragma): Remove.
796         * macro.c (builtin_macro): Remove pragma token hack.
797         (_cpp_push_token_context): Rename from push_token_context and export.
798         * internal.h (struct lexer_state): Add pragma_allow_expansion.
799         (_cpp_push_token_context): Declare.
800         * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
801         a token.  Update the line number correctly if so.
802         (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
803         (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
804         * include/cpplib.h (PRAGMA_EOL): New.
805         (CPP_TOKEN_FLD_PRAGMA): New.
806         (struct cpp_token): Add val.pragma.
807         (struct cpp_options): Remove defer_pragmas.
808         (cpp_handle_deferred_pragma): Remove.
809         (cpp_register_deferred_pragma): Declare.
811 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
813         PR c++/25294
814         * directives.c (do_pragma): If pragma line ends with multi-line
815         block comment, end the saved deferred pragma string before that
816         comment.  Handle embedded '\0' chars on the pragma line.
818 2005-12-22  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
820         PR c++/23333
821         * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
823 2005-12-07  Jon Grimm  <jgrimm2@us.ibm.com>
824             Ben Elliston  <bje@au.ibm.com>
826         * include/cpplib.h (CPP_N_DFLOAT): New.
827         * expr.c (interpret_float_suffix): Identify df, dd, and dl
828         suffixes as decimal floating point constants.
829         (cpp_classify_number): Disallow hexadecimal DFP constants.
831 2005-11-14  Gerald Pfeifer  <gerald@pfeifer.com>
832             Ian Lance Taylor  <ian@airs.com>
834         * include/cpplib.h (struct cpp_callbacks): Annotate error with
835         ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
837 2005-11-09  Per Bothner  <per@bothner.com>
838             Uros Bizjak  <uros@kss-loka.si>
840         PR c/24101
841         * init.c (read_original_filename): Temporarily set
842         state.in_directive before calling _cpp_lex_direct for
843         CPP_HASH tokens.
845 2005-11-03  James E Wilson  <wilson@specifix.com>
847         PR preprocessor/24202
848         * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
850 2005-11-04  Joseph S. Myers  <joseph@codesourcery.com>
852         * include/cpplib.h (struct cpp_callbacks): Make error take
853         va_list* parameter.
854         * errors.c (cpp_error): Update call to callback.
856 2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>
858         PR preprocessor/22042
859         * macro.c (_cpp_builtin_macro_text): Lower the needed max
860         buffer size.
861         (cpp_quote_string): Don't octalify non printable
862         charactors.
864 2005-11-03  Joseph S. Myers  <joseph@codesourcery.com>
866         PR c++/17964
867         * include/cpplib.h (struct cpp_options): Add client_diagnostic.
868         (struct cpp_callbacks): Add error.
869         * errors.c (cpp_error): If client_diagnostic, use error callback.
870         * charset.c (convert_escape): Don't use %03o in diagnostic.
872 2005-10-21  James E Wilson  <wilson@specifix.com>
874         PR preprocessor/15220
875         * files.c (_cpp_find_file): New parameter angle_brackets.  Fix all
876         callers.  Pass to open_file_failed.
877         (open_file_failed): New parameter angle_brackets.  Fix all callers.
878         Use in print_dep assignment.
879         * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
880         * internal.h (_cpp_find_file): Add new parm to declaration.
882 2005-10-08  Kazu Hirata  <kazu@codesourcery.com>
884         * configure.ac: Require 64-bit int for arm*-*-*eabi*.
885         * configure: Regenerate.
887 2005-10-04  Ian Lance Taylor  <ian@airs.com>
889         PR preprocessor/13726
890         * directives.c (check_eol_return_comments): New static function.
891         (parse_include): Add buf parameter.  Change all callers.
892         (do_include_common): If not discard comments, turn on
893         save_comments.  Pass collected comments to include callback.
894         * include/cpplib.h (struct cpp_callbacks): Add new parameter to
895         include callback: cpp_token list.
897 2005-09-20  Joseph S. Myers  <joseph@codesourcery.com>
899         * include/cpplib.h (struct cpp_options): Add extended_identifiers.
900         * init.c (struct lang_flags, lang_defaults): Add
901         extended_identifiers.
902         (cpp_set_lang): Use it.
903         * lex.c (forms_identifier_p): Check extended_identifiers.
905 2005-08-30  Jakub Jelinek  <jakub@redhat.com>
907         PR preprocessor/20348
908         PR preprocessor/20356
909         * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
910         2004-06-05 changes.
912 2005-07-23  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
914         * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
915         -Wmissing-format-attribute.
917         * configure: Regenerate.
919 2005-06-29  Kelley Cook  <kcook@gcc.gnu.org>
921         * all files: Update FSF address in copyright headers.
922         * makeucnid.c (write_copyright): Update outputted FSF address.
924 2005-06-13  Zack Weinberg  <zack@codesourcery.com>
926         * configure.ac: Invoke ZW_CREATE_DEPDIR and
927         ZW_PROG_COMPILER_DEPENDENCIES.
928         * aclocal.m4, configure: Regenerate.
929         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
930         New variables.
931         (distclean): Clean up $(DEPDIR) and its contents.
932         (.c.o): Use $(COMPILE).
933         Include $(DEPDIR)/*.Po for most object->header dependencies.
935 2005-05-28  Gabriel Dos Reis  <gdr@integrable-solutions.net>
937         * configure.ac: Check declarations for asprintf and vasprintf.
938         * config.in: Regenerate.
939         * configure: Likewise.
941         * charset.c (conversion_loop): Use XRESIZEVEC.
942         (convert_no_conversion): Likewise.
943         (convert_using_iconv): Likewise.
944         (init_iconv_desc): Cast return value of alloca.
945         (cpp_host_to_exec_charset): Use XNEWVEC.
946         (emit_numeric_escape): Use XRESIZEVEC.
947         (cpp_interpret_string): Use XNEWVEC.
948         (cpp_interpret_string): Use XRESIZEVEC.
949         (_cpp_interpret_identifier): Cast return value of alloca.
950         (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
951         * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
952         (parse_include): Use XNEWVEC.
953         (insert_pragma_entry): Rename local variable "new" to
954         "new_entry".
955         (save_registered_pragmas): Cast return value of xmemdup.
956         (destringize_and_run): Same for alloca.
957         (parse_assertion): Likewise.
958         (do_assert): Cast allocated storage to proper type.
959         (cpp_define): Likewise.
960         (_cpp_define_builtin): Likewise.
961         (cpp_undef): Likewise.
962         (handle_assertion): Likewise.
963         (cpp_push_buffer): Rename local variable "new" to "new_buffer".
964         * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
965         (CPP_UMINUS): Likewise.
966         (struct cpp_operator): Rename from struct operator.
967         (_cpp_expand_op_stack): Use XRESIZEVEC.
968         * files.c (pch_open_file): Use XNEWVEC.
969         (pch_open_file): Use XRESIZEVEC.
970         (read_file_guts): Use XNEWVEC and XRESIZEVEC.
971         (dir_name_of_file): Use XNEWVEC.
972         (make_cpp_file): Use XCNEW.
973         (make_cpp_dir): Likewise.
974         (allocate_file_hash_entries): USE XNEWVEC.
975         (cpp_included): Cast return value of htab_find_with_hash.
976         (append_file_to_dir): Use XNEWVEC.
977         (read_filename_string): Likewise. Use XRESIZEVEC too.
978         (read_name_map): Cast return value of alloca.  Use XRESIZEVEC.
979         (remap_filename): Use XNEWVEC.
980         (struct pchf_entry): Move definition out of struct pchf_data.
981         (_cpp_save_file_entries): Use XCNEWVAR.
982         (_cpp_read_file_entries): Use XNEWVAR.
983         * identifiers.c (alloc_node): Use XOBNEW.
984         * init.c (cpp_create_reader): Use XCNEW.
985         (cpp_init_builtins): Cast of b->value to enum builtin_type.
986         (read_original_directory): Cast return value of alloca.
987         * lex.c (add_line_note): Use XRESIZEVEC.
988         (warn_about_normalization): Use XNEWVEC.
989         (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
990         (new_buff): Use XNEWVEC.
991         * line-map.c (linemap_add): Use XRESIZEVEC.
992         * macro.c (builtin_macro): Cast return value of alloca.
993         (paste_tokens): Likewise.
994         (expand_arg): Use XNEWVEC and XRESIZEVEC.
995         (_cpp_save_parameter): Use XRESIZEVEC.
996         (create_iso_definition): Cast allocated storage to proper type.
997         (_cpp_create_definition): Likewise.
998         (cpp_macro_definition): Use XRESIZEVEC.
999         * makedepend.c (add_clm): Use XNEW.
1000         (add_dir): Likewise.
1001         * mkdeps.c (munge): Use XNEWVEC.
1002         (deps_init): Use XCNEW.
1003         (deps_add_target): Use XRESIZEVEC.
1004         (deps_add_default_target): Cast return value of alloca.
1005         (deps_add_dep): Use XRESIZEVEC.
1006         (deps_add_vpath): Likewise.  Use XNEWVEC too.
1007         (deps_restore): Likewise.
1008         * pch.c (save_idents): Use XNEW and XNEWVEC.
1009         (cpp_save_state): Use XNEW.
1010         (count_defs): Cast return value of htab_find.
1011         (write_defs): Likewise.
1012         (cpp_write_pch_deps): Use XNEWVEC.
1013         (collect_ht_nodes): Use XRESIZEVEC.
1014         (cpp_valid_state): Use XNEWVEC.
1015         (save_macros): Use XRESIZEVEC.  Cast return value of xmemdup.
1016         * symtab.c (ht_create): Use XCNEW.
1017         (ht_lookup_with_hash): Cast return value of obstack_copy0.
1018         (ht_expand): Use XCNEWVEC.
1019         * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
1020         (bool): Do not define if __cplusplus.
1022 2005-05-12  Zack Weinberg  <zack@codesourcery.com>
1024         * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
1025         (do_sccs): Delete function definition, #define to do_ident.
1026         (do_ident): Don't hardwire directive name.
1028 2005-05-12  Ryota Kunisawa  <kunisawa@access.co.jp>
1030         PR bootstrap/21230
1031         * configure: Regenerate.
1033 2005-04-27  Andris Pavenis  <pavenis@latnet.lv>
1035         * files.c: Include io.h for DJGPP to get prototype of setmode.
1037 2005-04-19  Per Bothner  <per@bothner.com>
1039         PR preprocessor/20907
1040         * line-map.c (linemap_line_start): Fix bug when we need to increse
1041         column_bits but can re-use the current line_map.
1043 2005-04-19  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1045         * system.h (fopen, fdopen, freopen): Define these to the unlocked
1046         libiberty functions.
1048 2005-04-11  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
1050         * configure.ac (libcpp_UNLOCKED_FUNCS): New.
1051         (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
1052         * system.h (putchar, getc, getchar, clearerr, feof, fileno,
1053         fflush, fgetc, fgets, ferror, fread): Redefine to the associated
1054         _unlocked function.
1055         (fwrite_unlocked): Fix prototype.
1057         * configure, config.in: Regenerate.
1059 2005-04-05  Jakub Jelinek  <jakub@redhat.com>
1061         PR preprocessor/19475
1062         * macro.c (create_iso_definition): For < ISO C99, don't
1063         pedwarn if there is no whitespace between macro name and its
1064         replacement, but the replacement starts with a basic character
1065         set character.
1067 2005-03-28  Andreas Jaeger  <aj@suse.de>
1069         * lex.c (warn_about_normalization): Cast field width to int to
1070         avoid warning.
1072 2005-03-19  Joseph S. Myers  <joseph@codesourcery.com>
1074         * configure.ac: Consistently use solaris2.1[0-9]* instead of
1075         solaris2.1[0-9].
1076         * configure: Regenerate.
1078 2005-03-15  Geoffrey Keating  <geoffk@apple.com>
1080         * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
1081         UCN rather than printing an error.
1083 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
1085         * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
1087 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
1089         * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
1090         * charset.c: Update for new format of ucnid.h.
1091         (ucn_valid_in_identifier): Update for new format of ucnid.h.
1092         Add NST parameter, and update it; update callers.
1093         (cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
1094         with cpp_error.
1095         (convert_ucn): Pass normalize_state to cpp_valid_ucn.
1096         * internal.h (struct normalize_state): New.
1097         (INITIAL_NORMALIZE_STATE): New.
1098         (NORMALIZE_STATE_RESULT): New.
1099         (NORMALIZE_STATE_UPDATE_IDNUM): New.
1100         (_cpp_valid_ucn): New.
1101         * lex.c (warn_about_normalization): New.
1102         (forms_identifier_p): Add normalize_state parameter, update callers.
1103         (lex_identifier): Add normalize_state parameter, update callers.  Keep
1104         the state current.
1105         (lex_number): Likewise.
1106         (_cpp_lex_direct): Pass normalize_state to subroutines.  Check
1107         it with warn_about_normalization.
1108         * makeucnid.c: New.
1109         * ucnid.h: Replace.
1110         * ucnid.pl: Remove.
1111         * ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
1112         comments about obsolete version of C++.
1113         * include/cpplib.h (enum cpp_normalize_level): New.
1114         (struct cpp_options): Add warn_normalize field.
1116 2005-03-11  Geoffrey Keating  <geoffk@apple.com>
1118         * directives.c (glue_header_name): Update call to cpp_spell_token.
1119         * internal.h (_cpp_interpret_identifier): New.
1120         * charset.c (_cpp_interpret_identifier): New.
1121         (_cpp_valid_ucn): Allow UCN version of '$'.
1122         * lex.c (lex_identifier): Add extra parameter to indicate if initial
1123         character was '$' or '\'.  Support identifiers with UCNs.
1124         (forms_identifier_p): Allow UCNs.
1125         (_cpp_lex_direct): Pass extra parameter to lex_identifier.
1126         (utf8_to_ucn): New.
1127         (cpp_spell_token): Add FORSTRING parameter.  Use it.
1128         (cpp_token_as_text): Update call to cpp_spell_token.
1129         (cpp_output_token): Write UCNs back out.
1130         (stringify_arg): Update call to cpp_spell_token.
1131         (paste_tokens): Likewise.
1132         (cpp_macro_definition): Likewise.
1133         * macro.c (stringify_arg): Likewise.
1134         (paste_tokens): Likewise.
1135         (cpp_macro_definition): Likewise.
1136         * include/cpplib.h: Add parameter to cpp_spell_token.
1138 2005-03-04  Jakub Jelinek  <jakub@redhat.com>
1140         PR bootstrap/20282
1141         PR bootstrap/20305
1142         * macro.c (replace_args, cpp_get_token): Copy whole
1143         cpp_token_u instead of just cpp_string field from it.
1145 2005-02-28  Devang Patel  <dpatel@apple.com>
1147         * directives.c (do_line): Save sysp early before line table is
1148         realloc'ed.
1150 2005-02-20  Zack Weinberg  <zack@codesourcery.com>
1152         PR 18785
1153         * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
1154         (cpp_host_to_exec_charset): New function.
1155         * include/cpplib.h: Declare cpp_host_to_exec_charset.
1157 2005-02-19  Devang Patel  <dpatel@apple.com>
1159         * charset.c (_cpp_convert_input): Check '\r' before inserting
1160         '\n' at the end.
1162 2005-02-15  Eric Christopher  <echristo@redhat.com>
1164         PR preprocessor/19077
1165         * macro.c (cpp_macro_definition): Move handling of whitespace
1166         to PREV_WHITE conditional. Remove overloading of len
1167         variable.
1169 2005-02-14  Kazu Hirata  <kazu@cs.umass.edu>
1171         * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
1172         traditional.c: Update copyright.
1174 2005-02-14  Paolo Bonzini  <bonzini@gnu.org>
1176         PR bootstrap/19818
1177         * configure.ac: Check for declaration of basename and getopt.
1178         * config.in: Regenerate.
1179         * configure: Regenerate.
1180         * internal.h (ustrcspn): New.
1181         * macro.c (create_iso_definition): Fix allocation of memory.
1182         (padding_token): Add cast to remove const-ness.
1183         * pch.c (cpp_read_state): Use ustrcspn.
1185 2005-02-08  Mike Stump  <mrs@apple.com>
1187         * files.c (pchf_adder): Remove.
1188         (struct pchf_adder_info): Likewise.
1189         (_cpp_save_file_entries): Write out all files so that #import works.
1191 2005-01-23  Joseph S. Myers  <joseph@codesourcery.com>
1193         * configure: Regenerate.
1195 2005-01-11  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
1197         * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
1199         * include/cpplib.h: Also update copyright years.
1201 2005-01-03  Geoffrey Keating  <geoffk@apple.com>
1203         * files.c (_cpp_find_file): Add files found by search_path_exhausted
1204         to the list of all files.
1206 2005-01-01  Gabriel Dos Reis  <gdr@integrable-solutions.net>
1208         * internal.h: Update references to Cpp lib filenames.
1209         * directives.c: Likewise.
1210         * init.c: Likewise.
1211         * macro.c: Likewise.
1212         * traditional.c: Likewise.
1214 2004-12-15  Eric Botcazou  <ebotcazou@libertysurf.fr>
1216         PR preprocessor/15167
1217         * files.c (destroy_cpp_file): New function.
1218         (should_stack_file): Make a new file if the
1219         compared file is still stacked.
1221 2004-11-28  Nathanael Nerode  <neroden@gcc.gnu.org>
1223         PR preprocessor/17610
1224         * directives.c (do_include_common): Error out if an empty filename
1225         is given for #include (or #include_next or #import).
1227 2004-11-27  Roger Sayle  <roger@eyesopen.com>
1228             Zack Weinberg  <zack@codesourcery.com>
1230         * internal.h: Replace all uses of uchar with unsigned char.
1231         * include/cpp-id-data.h: Likewise.  Guard typedef of uchar
1232         with !IN_GCC, so uchar is only defined whilst building libcpp.
1234 2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>
1236         * aclocal.m4: Regenerate.
1238 2004-11-24  Roger Sayle  <roger@eyesopen.com>
1240         PR preprocessor/15824
1241         * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
1242         directly, instead of the non-existant "system.h" and "ansidecl.h".
1243         * configure: Regenerate.
1245 2004-11-23  Daniel Jacobowitz  <dan@codesourcery.com>
1246             Joseph Myers  <joseph@codesourcery.com>
1248         * internal.h (struct lexer_state): Add in_deferred_pragma.
1249         * directives.c (struct pragma_entry): Add allow_expansion.
1250         (insert_pragma_entry): Take allow_expansion flag.
1251         (register_pragma): Likewise.
1252         (cpp_register_pragma): Likewise.
1253         (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
1254         (do_pragma): Honor allow_expansion.
1255         (cpp_handle_deferred_pragma): Set in_deferred_pragma.
1256         * include/cpplib.h (cpp_register_pragma): Update prototype.
1258 2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
1259             Mark Mitchell  <mark@codesourcery.com>
1261         * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
1262         need_64bit_hwint=yes.
1263         * configure: Regenerate.
1265 2004-11-09  Joseph S. Myers  <joseph@codesourcery.com>
1267         * Makefile.in ($(PACKAGE).pot): New rule.  Depend on
1268         po/$(PACKAGE).pot.
1269         (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
1270         arguments.  Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
1271         Remove local srcdir path from generated file.
1273 2004-11-04  Zack Weinberg  <zack@codesourcery.com>
1274             Gerald Pfeifer  <gerald@pfeifer.com>
1276         * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
1277         as well.
1279 2004-10-27  Zack Weinberg  <zack@codesourcery.com>
1281         PR 18075
1282         * directives.c (do_pragma): Do not defer pragmas which are unknown.
1283         (cpp_handle_deferred_pragma): Add cast to silence warning.
1285 2004-10-14  Joseph S. Myers  <jsm@polyomino.org.uk>
1287         * errors.c (_cpp_begin_message): Print "error: " for errors.
1289 2004-10-10  Andreas Jaeger  <aj@suse.de>
1291         * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
1292         * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
1294 2004-10-08  Andrew Pinski  <pinskia@physics.uc.edu>
1296         * pch.c (cpp_write_pch_state): Remove variable z as it is not
1297         used.
1298         (cpp_read_state): Remove unused variables, m, d and mac_count.
1300 2004-09-29  Per Bothner  <per@bothner.com>
1302         * directives.c (cpp_handle_deferred_pragma):  Save, clear and restore
1303         cb.line_change.  Otherwise do_pragma will call the line_change
1304         call-back with a meaningless line number.
1306 2004-09-24  Zack Weinberg  <zack@codesourcery.com>
1308         * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
1309         programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
1310         ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
1311         * aclocal.m4, configure: Regenerate.
1312         * init.c: Include localedir.h.
1313         * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
1314         (DEFS): Delete.
1315         (.c.o): Use $(ALL_CFLAGS).
1316         (localedir.h, localedir.hs): New rules.
1317         (clean): Use rm -rf to remove directories.
1318         (distclean): Also delete localedir.h and localedir.hs.
1319         (init.o): Update dependencies.
1321 2004-09-22  Kelley Cook  <kcook@gcc.gnu.org>
1323         * Makefile.in (aclocal.m4): Update dependencies.
1324         * configure.ac (AC_CONFIG_MACRO_DIR): New.
1325         * aclocal.m4, configure: Regenerate.
1327 2004-09-17  Zack Weinberg  <zack@codesourcery.com>
1329         * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
1330         (_cpp_convert_input, _cpp_default_encoding): Add comments.
1331         Some other comments in this file also tweaked.
1333         * directives.c (do_pragma): Save current buffer position
1334         before lexing the pragma keywords; don't call
1335         _cpp_backup_tokens in the defer_pragmas case.
1337 2004-09-15  Per Bothner  <per@bothner.com>
1339         * include/line-map.h (line_map_start):  Add parameter names so
1340         preceding comment makes sense.
1341         (linemap_add):  Remove from comment mention of non-existing parameter.
1343 2004-09-09  Matt Austern  <austern@apple.com>
1344             Zack Weinberg  <zack@codesourcery.com>
1346         * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
1347         prefixes throughout.  Add entry for PRAGMA.  Remove
1348         unnecessary "= 0" from EQ.
1349         (enum cpp_ttype): Adjust OP and TK definitions to restore
1350         prefixes, via token-paste.
1351         (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
1352         Change from #defines to additional cpp_ttype enumerators.
1353         (struct cpp_options): Add defer_pragmas.
1354         (cpp_handle_deferred_pragma): Prototype new interface.
1356         * internal.h (struct cpp_reader): Add directive_result.
1357         * directives.c (struct pragma_entry): Add is_internal field;
1358         give boolean fields type bool.
1359         (start_directive): Initialize pfile->directive_result.type.
1360         (_cpp_do__Pragma): Likewise.
1361         (run_directive): Do not crash if pfile->buffer->prev is NULL.
1362         (insert_pragma_entry): Add 'internal' argument; set new->is_internal
1363         from it.
1364         (register_pragma): New static function, bulk of former
1365         cpp_register_pragma here; add 'internal' argument, pass along
1366         to insert_pragma_entry.
1367         (cpp_register_pragma): Now a wrapper around register_pragma which
1368         always passes false for 'internal' argument.
1369         (_cpp_init_internal_pragmas): Call register_pragma directly, passing
1370         true for 'internal'.
1371         (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
1372         an internal pragma, save text till the end of the line as a CPP_PRAGMA
1373         token instead of executing the pragma.
1374         (cpp_handle_deferred_pragma): New interface.
1375         * lex.c (token_spellings): Adjust OP and TK definitions to
1376         match changes to cpplib.h.
1377         (_cpp_lex_token): Check for a directive-result token and
1378         return it if present.
1379         (cpp_token_val_index): Handle CPP_PRAGMA.
1380         * macro.c (cpp_builtin_macro_text): Correct comment.
1381         (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
1383 2004-09-06  Serge Belyshev  <belyshev@lubercy.com>
1385         PR preprocessor/14699
1386         * symtab.c (ht_dump_statistics): Change type of sum_of_squares
1387         from size_t to double.
1389 2004-08-28  Andreas Schwab  <schwab@suse.de>
1390             Andreas Jaeger <aj@suse.de>
1392         * configure.ac: Set PACKAGE correctly.
1393         * configure: Regenerated.
1395 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
1397         * Makefile.in: Add back top_builddir.
1399 2004-08-25  Paolo Bonzini  <bonzini@gnu.org>
1401         * configure.ac: Replace Automake macro invocations
1402         with manual Autoconf checks and substitutions.
1403         * configure: Regenerate.
1404         * aclocal.m4: Regenerate.
1405         * config.in: Regenerate.
1406         * Makefile.am: Removed.
1407         * Makefile.in: Heavy simplification and reorganization.
1409 2004-08-09  Mark Mitchell  <mark@codesourcery.com>
1411         * configure.ac (arm*-*-eabi*): New target.
1412         (arm*-*-symbianelf*): Likewise.
1413         * configure: Regenerated.
1415 2004-07-24  Bernardo Innocenti  <bernie@develer.com>
1417         * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
1418         * directives.c: Use XNEW-family macros from libiberty.
1419         * lex.c: Likewise.
1420         * macro.c: Likewise.
1421         * cpplib.h (cpp_deps_style): Export enum with name.
1423 2004-07-23  Matthias Klose  <doko@debian.org>
1425         * init.c (init_library): Use PACKAGE for the text domain.
1427 2004-07-16  Andris Pavenis  <pavenis@latnet.lv>
1429         PR preprocessor/16366
1430         * internal.h (struct cpp_reader): New field dir_hash.
1431         * files.c (make_cpp_dir): Use dir_hash, not file_hash.
1432         (_cpp_init_files, _cpp_cleanup_files): Update for new field.
1434 2004-07-04  Neil Booth  <neil@duron.akihabara.co.uk>
1436         PR preprocessor/16192
1437         PR preprocessor/15913
1438         PR preprocessor/15572
1439         * expr.c (_cpp_parse_expr): Handle remaining cases where an
1440         expression is missing.
1441         * init.c (post_options): Traditional cpp doesn't do // comments.
1443 2004-06-30  Per Bothner  <per@bothner.com>
1445         * include/line-map.h (fileline):  Remove old typedef.
1446         * internal.h (struct cpp_reader):  Use source_location typedef instead.
1448 2004-06-26  Zack Weinberg  <zack@codesourcery.com>
1450         Partially revert patch of 2004-06-05.
1451         * files.c (search_cache): Remove pfile argument.  Don't check
1452         for file that would be found by "" or <> search here...
1453         (_cpp_find_file): ...do it here, before calling find_file_in_dir.
1454         Do not apply directory-of-current-file correction to files
1455         found by this check.  Rearrange code slightly.
1457 2004-06-21  Geoffrey Keating  <geoffk@apple.com>
1459         * files.c (should_stack_file): Correct swapped parameters to call
1460         to cb.read_pch.
1461         * pch.c (cpp_valid_state): Handle -fpreprocessed.
1463 2004-06-15  Paolo Bonzini  <bonzini@gnu.org>
1465         * Makefile.in: Regenerate with automake 1.8.5.
1466         * aclocal.m4: Likewise.
1467         * configure: Regenerate.
1469 2004-06-11  Zack Weinberg  <zack@codesourcery.com>
1471         * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
1472         * configure, config.in: Regenerate.
1473         * system.h: Unconditionally define bool as unsigned char,
1474         BOOL_BITFIELD as unsigned int.
1475         * .cvsignore: New file.
1477 2004-06-09  Geoffrey Keating  <geoffk@apple.com>
1479         * traditional.c (push_replacement_text): Set macro->traditional.
1480         (save_replacement_text): Likewise.
1481         * pch.c (cpp_write_pch_state): Don't write list of defined macros.
1482         (struct save_macro_item): Delete.
1483         (struct save_macro_data): Use a character array not the previous
1484         structured format.
1485         (save_macros): Save macro as text not as internal structures.
1486         (cpp_prepare_state): Update for changes to save_macro_data.
1487         (cpp_read_state): Don't read macros defined in PCH.  Restore
1488         -D macros as text.
1489         * macro.c (create_iso_definition): Honour alloc_subobject.
1490         Clear traditional flag.
1491         (_cpp_create_definition): Honour alloc_subobject.
1492         * lex.c (cpp_token_val_index): New.
1493         * internal.h: Include cpp-id-data.h.
1494         (uchar): Move definition to cpp-id-data.h.
1495         (U): Likewise.
1496         (cpp_macro): Likewise.
1497         * directives.c (struct answer): Move to cpp-id-data.h.
1498         (do_assert): Honour alloc_subobject.
1500         * include/symtab.h (struct ht): Add field 'alloc_subobject'.
1501         * include/cpplib.h (struct cpp_string): Add GTY marker.
1502         (enum cpp_token_fld_kind): New.
1503         (struct cpp_token): Add GTY markers.
1504         (cpp_token_val_index): Prototype.
1505         (CPP_HASHNODE_VALUE_IDX): New.
1506         (struct cpp_hashnode): Don't skip fields of 'value' when marking.
1507         * include/cpp-id-data.h: New file.
1509 2004-06-09  Paolo Bonzini  <bonzini@gnu.org>
1511         * Makefile.am (all-local): New.
1512         * Makefile.in: Regenerate.
1514 2004-06-06  Roger Sayle  <roger@eyesopen.com>
1516         * Makefile.am (LIBICONV): Declare.
1517         (makedepend_LDADD): Use LIBICONV.
1518         * Makefile.in: Regenerate.
1520 2004-06-05  Andrew Pinski  <pinskia@physics.uc.edu>
1522         * Makefile.am (LIBINTL): Declare
1523         (makedepend_LDADD): Use LIBINTL.
1524         * Makefile.in: Regenerate.
1526 2004-06-05  Zack Weinberg  <zack@codesourcery.com>
1528         * Makefile.am: Add makedepend.
1529         * Makefile.in, aclocal.m4: Regenerate.
1530         * charset.c: Insert a space to avoid a warning.
1531         * directives.c: Include mkdeps.h.
1532         (_cpp_handle_directive): Reenable macro expander if appropriate.
1533         (undefine_macros): Inline body of _cpp_free_definition for speed.
1534         Do not call undef callback or _cpp_warn_if_unused_macro.
1535         (cpp_get_deps): New interface.
1536         * files.c (search_cache): Add pfile argument.  Check for file
1537         that would be found by "" or <> search here...
1538         (_cpp_find_file): ...not here.  Correct recorded start_dir of
1539         files found by directory-of-current-file search that would be
1540         found by "" or <> search.
1541         * init.c (cpp_add_dependency_target): Delete.
1542         * internal.h (struct lexer_state): Add discarding_output flag.
1543         * lex.c (lex_identifier): Compute hash function while scanning.
1544         * macro.c (cpp_scan_nooutput): Disable macro expansion outside
1545         directives.
1546         * makedepend.c: New file.
1547         * mkdeps.c (struct deps): Add vpath vector.
1548         (apply_vpath, deps_add_vpath): New function.
1549         (deps_free): Free vpath vector.
1550         (deps_add_dep, deps_add_target): Use apply_vpath.
1551         * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
1552         (ht_lookup_with_hash): New function.
1553         * cpplib.h, mkdeps.h: Update prototypes.
1554         * symtab.h: Update prototypes.
1555         (HT_HASHSTEP, HT_FINISH): New macros.
1557 2004-05-29  Geoffrey Keating  <geoffk@apple.com>
1559         * symtab.c (ht_create): Set entries_owned.
1560         (ht_destroy): Honour entries_owned.
1561         (ht_expand): Likewise.
1562         (ht_load): New.
1563         * include/symtab.h (struct ht): New field 'entries_owned'
1564         (ht_load): New prototype.
1566 2004-05-26  Paolo Bonzini  <bonzini@gnu.org>
1568         PR bootstrap/15651
1569         * configure.ac: Fix m4 quoting when picking
1570         the size of HOST_WIDE_INT.
1571         * configure: Regenerate.
1573 2004-05-25  Paolo Bonzini  <bonzini@gnu.org>
1575         * Makefile.am: the correct directory for
1576         gettext include files is given by @INCINTL@.
1577         * Makefile.in: Regenerate.
1579 2004-05-24  Paolo Bonzini  <bonzini@gnu.org>
1581         * system.h [!ENABLE_NLS]: dgettext takes two
1582         parameters.
1584 2004-05-23  Paolo Bonzini  <bonzini@gnu.org>
1586         Moved libcpp from the gcc subdirectory to the toplevel.
1587         * Makefile.am: New file.
1588         * Makefile.in: Regenerate.
1589         * configure.ac: New file.
1590         * configure: Regenerate.
1591         * config.in: Regenerate.
1592         * charset.c: Moved from gcc/cppcharset.c.  Add note about
1593         brokenness of input charset detection.  Adjust for change
1594         in name of cppucnid.h.
1595         * errors.c: Moved from gcc/cpperror.c.  Do not include intl.h.
1596         * expr.c: Moved from gcc/cppexp.c.
1597         * files.c: Moved from gcc/cppfiles.c.  Do not include intl.h.
1598         Remove #define of O_BINARY, it is in system.h.
1599         * identifiers.c: Moved from gcc/cpphash.c.
1600         * internal.h: Moved from gcc/cpphash.h.  Change header
1601         guard name.  All other files adjusted to match name change.
1602         * init.c: Moved from gcc/cppinit.c.
1603         (init_library) [ENABLE_NLS]: Call bindtextdomain.
1604         * lex.c: Moved from gcc/cpplex.c.
1605         * directives.c: Moved from gcc/cpplib.c.
1606         * macro.c: Moved from gcc/cppmacro.c.
1607         * pch.c: Moved from gcc/cpppch.c.  Do not include intl.h.
1608         * traditional.c: Moved from gcc/cpptrad.c.
1609         * ucnid.h: Moved from gcc/cppucnid.h.  Change header
1610         guard name.
1611         * ucnid.pl: Moved from gcc/cppucnid.pl.
1612         * ucnid.tab: Moved from gcc/cppucnid.tab.  Change header
1613         guard name.
1614         * symtab.c: Moved from gcc/hashtable.c.
1615         * line-map.c: Moved from gcc.  Do not include intl.h.
1616         * mkdeps.c: Moved from gcc.
1617         * system.h: New file.
1618         * include/cpplib.h: Moved from gcc.  Change header guard name.
1619         * include/line-map.h: Moved from gcc.  Change header guard name.
1620         * include/mkdeps.h: Moved from gcc.  Change header guard name.
1621         * include/symtab.h: Moved from gcc/hashtable.h.  Change header
1622         guard name.