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