re PR tree-optimization/43833 (false warning: array subscript is above array bounds...
[gcc.git] / libcpp / ChangeLog
1 2010-04-25 Joseph Myers <joseph@codesourcery.com>
2
3 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
4 * init.c (lang_defaults): Add entries for new language variants.
5 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
6 variants.
7
8 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
9
10 PR cpp/43195
11 * files.c (report_missing_guard): Test for #pragma once.
12
13 2010-04-07 Simon Baldwin <simonb@google.com>
14
15 * directives.c (do_diagnostic): Add warning reason argument,
16 call appropriate error reporting function for code.
17 (directive_diagnostics): Call specific warning functions with
18 warning reason where appropriate.
19 (do_error, do_warning, do_pragma_dependency): Add warning reason
20 argument to do_diagnostic calls.
21 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
22 _cpp_create_definition): Call specific warning functions with
23 warning reason where appropriate.
24 * Makefile.in: Add new diagnostic functions to gettext translations.
25 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
26 to error callback.
27 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
28 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
29 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
30 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
31 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
32 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
33 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
34 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
35 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
36 warning reason codes.
37 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
38 cpp_warning_with_line, cpp_pedwarning_with_line,
39 cpp_warning_with_line_syshdr): New specific error reporting functions.
40 * pch.c (cpp_valid_state): Call specific warning functions with
41 warning reason where appropriate.
42 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
43 diagnostic handlers.
44 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
45 cpp_warning_with_line, cpp_pedwarning_with_line,
46 cpp_warning_with_line_syshdr): New specific error reporting functions.
47 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
48 specific warning functions with warning reason where appropriate.
49 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
50 warn_about_normalization, lex_identifier_intern, lex_identifier,
51 _cpp_lex_direct): Ditto.
52 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
53 narrow_str_to_charconst): Ditto.
54
55 2010-04-06 Jakub Jelinek <jakub@redhat.com>
56
57 PR preprocessor/43642
58 * lex.c (lex_raw_string): Change type of TYPE variable to
59 unsigned char.
60
61 2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
62
63 * aclocal.m4: Regenerate.
64
65 2010-03-29 Jason Merrill <jason@redhat.com>
66
67 More N3077 raw string changes
68 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
69 strings.
70 * lex.c (bufring_append): Split out from...
71 (lex_raw_string): ...here. Undo trigraph and line splicing
72 transformations. Do process line notes in multi-line literals.
73 (_cpp_process_line_notes): Ignore notes that were already handled.
74
75 Some raw string changes from N3077
76 * charset.c (cpp_interpret_string): Change inner delimiters to ().
77 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
78
79 2010-02-11 Jakub Jelinek <jakub@redhat.com>
80
81 * init.c (read_original_filename): Don't call read_original_directory
82 if _cpp_handle_directive returns 0.
83
84 2010-01-01 Joseph Myers <joseph@codesourcery.com>
85
86 PR preprocessor/41947
87 * expr.c (cpp_classify_number): Give error for hexadecimal
88 floating-point constant with no digits before or after point.
89
90 2009-11-20 Arnaud Charlet <charlet@adacore.com>
91
92 * macro.c (enter_macro_context): Call cb.used callback if defined.
93 * directives.c (do_idef, do_ifndef): Ditto.
94 * include/cpplib.h (struct cpp_callbacks): Add used callback.
95
96 2009-11-11 Kai Tietz <kai.tietz@onevision.com>
97
98 * directives.c (do_pragma_push_macro): New pragma handler.
99 (do_pragma_pop_macro): Likewise.
100 (_cpp_init_internal_pragmas): Add push_macro and
101 pop_macro handler to internal pragmas.
102 (lex_macro_node_from_str): Removed.
103 (cpp_push_definition): Replace lex_macro_node_from_str
104 by _cpp_lex_identifier.
105 (cpp_pop_definition): Likewise.
106 * internal.h (_cpp_lex_identifier): New prototype.
107 (def_pragma_macro): New structure.
108 (cpp_reader): New member pushed_macros.
109 * lex.c (_cpp_lex_identifier): New function.
110 (lex_identifier_intern): New function.
111 * init.c (cpp_create_reader): Initialize pushed_macros
112 member.
113 (cpp_destroy): Free elements in pushed_macros member.
114 * pch.c (_cpp_save_pushed_macros): New function.
115 (_cpp_restore_pushed_macros): Likewise.
116 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
117 (cpp_read_state): Use _cpp_restore_pushed_macros.
118
119 2009-10-19 Jakub Jelinek <jakub@redhat.com>
120
121 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
122 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
123 and char32_cset_desc.
124 (converter_for_type): Handle CPP_UTF8STRING.
125 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
126 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
127 (parse_include): Reject raw strings.
128 * include/cpplib.h (CPP_UTF8STRING): New token type.
129 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
130 * lex.c (lex_raw_string): New function.
131 (lex_string): Handle u8 string literals, call lex_raw_string
132 for raw string literals.
133 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
134 sequences.
135 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
136
137 2009-10-14 Jakub Jelinek <jakub@redhat.com>
138
139 PR preprocessor/41543
140 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
141 * line-map.c (linemap_init): Initialize highest_location and
142 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
143
144 2009-10-09 Jason Merrill <jason@redhat.com>
145
146 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
147
148 2009-10-09 Neil Vachharajani <nvachhar@google.com>
149
150 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
151 sccs.
152
153 2009-09-23 Loren J. Rittle <ljrittle@acm.org>
154
155 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
156 * configure: Rebuilt.
157
158 2009-09-22 Richard Guenther <rguenther@suse.de>
159
160 PR pch/38987
161 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
162
163 2009-09-18 Chris Demetriou <cgd@google.com>
164
165 PR preprocessor/28435:
166 * include/cpplib.h (struct cpp_options): Add new member
167 deps.need_preprocessor_output.
168 * files.c (open_file_failed): If preprocessor output is needed
169 always report an error.
170
171 2009-09-13 Kai Tietz <kai.tietz@onevision.com>
172
173 * configure.ac: Set for i?86-w64-mingw*
174 need_64bit_hwint to yes.
175 * configure: Regenerated.
176
177 2009-09-10 Jason Merrill <jason@redhat.com>
178
179 * directives.c (cpp_define): constify.
180
181 2009-09-02 Ian Lance Taylor <iant@google.com>
182
183 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
184
185 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
186
187 * configure.ac (AC_PREREQ): Bump to 2.64.
188
189 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
190
191 * aclocal.m4: Regenerate.
192 * config.in: Regenerate.
193 * configure: Regenerate.
194
195 2009-08-17 Tom Tromey <tromey@redhat.com>
196
197 PR preprocessor/41067:
198 * charset.c (convert_escape): Add missing ":" to error text.
199
200 2009-07-27 Douglas B Rupp <rupp@gnat.com>
201
202 * include/cpplib.h (INO_T_CPP): New macro.
203 (struct cpp_dir): Use it.
204
205 2009-07-20 Jerry Quinn <jlquinn@optonline.net>
206
207 PR regression/40800
208 * configure.ac: Use = instead of == for testing
209 ENABLE_BUILD_WITH_CXX.
210 * configure: Rebuild.
211
212 2009-07-17 Jerry Quinn <jlquinn@optonline.net>
213
214 * directives.c (do_linemarker, do_line): Use CPP_STRING for
215 ignored enum value.
216 * files.c (find_file_in_dir): Add cast from void* to char*.
217 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
218 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
219 warnings.
220 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
221 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
222 COMPILER_FLAGS): New.
223 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
224 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
225 instead of ALL_CFLAGS.
226 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
227 from other warnings. Add -Wc++-compat to C-specific warnings.
228 Check for --enable-build-with-cxx. Set and substitute
229 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
230 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
231 AC_CHECK_HEADERS.
232 * configure: Rebuild.
233 * include/cpp-id-data.h: Remove extern "C".
234 * include/line-map.h: Likewise.
235 * include/mkdeps.h: Likewise.
236 * include/symtab.h: Likewise.
237 * internal.h: Likewise.
238
239 2009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
240
241 * directives.c (parse_include): Add location argument. Update all
242 calls.
243 (parse_answer): Likewise.
244 (do_include_common): Error with exact location.
245 (parse_assertion): Likewise.
246
247 2009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
248
249 * expr.c (num_div_op): Take explicit location.
250
251 2009-06-17 Ian Lance Taylor <iant@google.com>
252
253 * include/cpplib.h (progname): Don't declare.
254
255 2009-06-12 Ian Lance Taylor <iant@google.com>
256
257 * include/cpplib.h (struct cpp_options): Add
258 warn_cxx_operator_names field.
259 (NODE_WARN_OPERATOR): Define.
260 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
261 type to 6 bits.
262 * init.c (mark_named_operators): Add flags parameter.
263 (cpp_post_options): Pick flags value to pass to
264 mark_named_operators.
265 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
266 identifier is an operator name in C++.
267
268 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
269
270 * include/line-map.h (LAST_SOURCE_COLUMN): New.
271
272 2009-06-01 Ian Lance Taylor <iant@google.com>
273
274 * include/cpp-id-data.h: Add extern "C".
275 * include/line-map.h: Likewise.
276 * include/mkdeps.h: Likewise.
277 * include/symtab.h: Likewise.
278 * internal.h: Likewise.
279
280 2009-05-15 Ian Lance Taylor <iant@google.com>
281
282 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
283 builtin_type. Change all uses.
284
285 2009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
286
287 PR cpp/36674
288 * directives (do_linemarker): Compensate for the increment in
289 location that occurs when we reach the end of line.
290 * files (_cpp_stack_include): Mention _cpp_find_file in the
291 comment.
292
293 2009-05-10 Joseph Myers <joseph@codesourcery.com>
294
295 * include/cpplib.h (enum cpp_token_fld_kind): Add
296 CPP_TOKEN_FLD_TOKEN_NO.
297 (struct cpp_macro_arg, struct cpp_identifier): Define.
298 (union cpp_token_u): Use struct cpp_identifier for identifiers.
299 Use struct cpp_macro_arg for macro arguments. Add token_no for
300 CPP_PASTE token numbers.
301 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
302 do_pragma_poison, parse_assertion): Use val.node.node in place of
303 val.node.
304 * expr.c (parse_defined, eval_token): Use val.node.node in place
305 of val.node.
306 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
307 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
308 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
309 place of val.arg_no. Use val.node.node in place of val.node.
310 * macro.c (replace_args, cpp_get_token, parse_params,
311 lex_expansion_token, create_iso_definition, cpp_macro_definition):
312 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
313 Use val.node.node in place of val.node.
314
315 2009-05-03 Joseph Myers <joseph@codesourcery.com>
316
317 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
318 UTF-8 sequences.
319
320 2009-04-25 Joseph Myers <joseph@codesourcery.com>
321
322 PR preprocessor/39559
323 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
324 constants larger than intmax_t in C99 mode.
325
326 2009-04-21 Taras Glek <tglek@mozilla.com>
327
328 * include/cpp-id-data.h: Update GTY annotations to new syntax.
329 * include/cpplib.h: Likewise.
330 * include/line-map.h: Likewise.
331 * include/symtab.h: Likewise.
332
333 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
334
335 PR c++/14875
336 * lex.c (cpp_type2name): Take a flags parameter. Call
337 cpp_named_operator2name for named operators and cpp_digraph2name
338 for digraphs.
339 (cpp_digraph2name): New.
340 (cpp_spell_token): Use it.
341 (cpp_output_token): Likewise.
342 * include/cpplib.h (cpp_type2name): Update declaration.
343 * init.c (cpp_named_operator2name): New.
344 * internal.h (cpp_named_operator2name): Declare.
345
346 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
347
348 PR c++/13358
349 * init.c (cpp_create_reader): Wlong_long is disabled by default.
350 * expr.c (cpp_classify_number): Give different messages for C and
351 C++ front-ends.
352
353 2009-04-19 Joseph Myers <joseph@codesourcery.com>
354
355 PR preprocessor/20078
356 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
357 field.
358 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
359 (struct cpp_token): Change flags to unsigned short.
360 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
361 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
362 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
363 tokens.
364 * macro.c (macro_real_token_count): New.
365 (enter_macro_context, replace_args): Use macro_real_token_count.
366 (create_iso_definition): Record whitespace surrounding and digraph
367 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
368 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
369 multiple consecutive ## tokens.
370 (_cpp_create_definition): Initialize extra_tokens.
371 (cpp_macro_definition): Use macro_real_token_count.
372
373 2009-04-18 Joseph Myers <joseph@codesourcery.com>
374
375 * directives.c (parse_include): Pass true to check_eol.
376
377 2009-04-18 Joseph Myers <joseph@codesourcery.com>
378
379 PR preprocessor/39646
380 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
381 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
382 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
383 place of LC_RENAME.
384
385 2009-04-18 Joseph Myers <joseph@codesourcery.com>
386
387 PR preprocessor/39647
388 * directives.c (check_eol): Add parameter expand.
389 (do_undef, parse_include, do_line, do_linemarker, do_ident,
390 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
391 do_else, do_endif, do_assert, do_unassert): All callers changed.
392 Pass true from do_line, false elsewhere.
393
394 2009-04-12 Joseph Myers <joseph@codesourcery.com>
395
396 PR preprocessor/31869
397 * macro.c (stringify_arg): Handle NULL source token in padding
398 token where previous padding token did not have source token with
399 preceding whitespace.
400
401 2009-04-09 Jakub Jelinek <jakub@redhat.com>
402
403 * Makefile.in: Change copyright header to refer to version
404 3 of the GNU General Public License and to point readers at the
405 COPYING3 file and the FSF's license web page.
406 * charset.c: Likewise.
407 * directives-only.c: Likewise.
408 * directives.c: Likewise.
409 * errors.c: Likewise.
410 * expr.c: Likewise.
411 * files.c: Likewise.
412 * identifiers.c: Likewise.
413 * include/cpp-id-data.h: Likewise.
414 * include/cpplib.h: Likewise.
415 * include/line-map.h: Likewise.
416 * include/mkdeps.h: Likewise.
417 * include/symtab.h: Likewise.
418 * init.c: Likewise.
419 * internal.h: Likewise.
420 * lex.c: Likewise.
421 * line-map.c: Likewise.
422 * macro.c: Likewise.
423 * makeucnid.c: Likewise.
424 * mkdeps.c: Likewise.
425 * pch.c: Likewise.
426 * symtab.c: Likewise.
427 * system.h: Likewise.
428 * traditional.c: Likewise.
429 * ucnid.tab: Likewise.
430 * ucnid.h: Regenerate.
431
432 2009-04-01 Janis Johnson <janis187@us.ibm.com>
433
434 PR c/39027
435 * include/cpplib.h (CPP_N_DEFAULT): Define.
436 * expr.c (interpret_float_suffix): Recognize d or D for double,
437 return new value for default.
438 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
439
440 PR c/33466
441 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
442 letters from decimal float and fixed-point suffixes.
443
444 2009-03-31 Joseph Myers <joseph@codesourcery.com>
445
446 PR preprocessor/15638
447 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
448 invalid PCH.
449 (open_file_failed): Make error for missing file fatal.
450 * include/cpplib.h (CPP_DL_FATAL): Define.
451
452 2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
453
454 PR preprocessor/31932:
455 * internal.h: Don't mention HAVE_ICONV_H.
456 * configure, config.in: Rebuild.
457 * configure.ac: Don't check for iconv.h.
458
459 2009-03-30 Tom Tromey <tromey@redhat.com>
460
461 PR preprocessor/39512:
462 * line-map.c (linemap_init): Initialize 'reallocator' field.
463
464 2009-03-30 Jakub Jelinek <jakub@redhat.com>
465
466 PR target/39558
467 * macro.c (cpp_get_token): If macro_to_expand returns NULL
468 and used some tokens, add CPP_PADDING before next token.
469
470 2009-03-29 Joseph Myers <joseph@codesourcery.com>
471
472 PR preprocessor/34695
473 * makedepend.c: Remove.
474 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
475 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
476 * directives.c (cpp_errors): Remove.
477 * errors.c (print_location, _cpp_begin_message, v_message):
478 Remove.
479 (cpp_error, cpp_error_with_line): Always use error callback.
480 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
481 * include/cpplib.h (cpp_options): Remove pedantic_errors,
482 inhibit_warnings, warn_system_headers, inhibit_errors,
483 warnings_are_errors, client_diagnostic.
484 (cpp_callbacks): Add extra arguments to error callback; make it
485 return bool.
486 (cpp_finish): Return void.
487 (cpp_destroy): Remove inaccurate comment about return value.
488 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
489 (CPP_DL_NOTE): Define.
490 * include/line-map.h (linemap_print_containing_files): Remove.
491 * init.c (cpp_finish): Do not check for or return number of
492 errors.
493 * internal.h (cpp_reader): Remove errors field.
494 * line-map.c (linemap_print_containing_files): Remove.
495 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
496 about previous definition. Only emit it if previous diagnostic
497 was emitted.
498
499 2009-03-28 Joseph Myers <joseph@codesourcery.com>
500
501 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
502 mkinstalldirs.
503
504 2009-03-18 Jakub Jelinek <jakub@redhat.com>
505
506 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
507
508 2009-02-21 Joseph Myers <joseph@codesourcery.com>
509
510 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
511 header name.
512 (_cpp_lex_direct): Handle this.
513
514 2009-02-15 Richard Guenther <rguenther@suse.de>
515
516 Revert last change.
517
518 2009-02-13 Richard Guenther <rguenther@suse.de>
519
520 * configure.ac: Enable LFS.
521 * configure: Re-generate.
522 * config.in: Likewise.
523
524 2009-01-05 Ben Elliston <bje@au.ibm.com>
525
526 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
527 (.po.pox): Likewise.
528 (po/$(PACKAGE).pot): Likewise.
529
530 2008-12-10 Alexandre Oliva <aoliva@redhat.com>
531
532 PR target/37033
533 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
534 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
535
536 2008-11-29 Joseph Myers <joseph@codesourcery.com>
537
538 * lex.c (cpp_token_len): Use 6 as default length.
539
540 2008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
541
542 * expr.c (struct op): Add location.
543 (_cpp_parse_expr): Propagate locations throught the stack
544 of expressions.
545 (reduce): Likewise.
546 (check_promotion): Use explicit location in errors.
547
548 2008-10-05 Matthew Gingell <gingell@adacore.com>
549 Arnaud Charlet <charlet@adacore.com>
550
551 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
552 (cpp_get_comments): New function.
553 * internal.h (struct cpp_reader): Add comments field.
554 * init.c (cpp_destroy): Free comments.
555 * lex.c (store_comment, cpp_get_comments): New functions.
556 (comments): New struct.
557 (save_comment): Store comments in comments struct.
558
559 2008-09-18 Simon Baldwin <simonb@google.com>
560
561 * include/cpplib.h (struct cpp_options): Add new boolean flag
562 warn_builtin_macro_redefined.
563 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
564 * (struct builtin_operator): Split out from previous struct builtin,
565 enhance extra const correctness.
566 * (struct builtin_macro): Split out from previous struct builtin, add
567 new always_warn_if_redefined flag, enhance const correctness.
568 * (mark_named_operators): Use struct builtin_operator.
569 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
570 to builtins selectively.
571 * macro.c (warn_of_redefinition): Return false if a builtin macro
572 is not flagged with NODE_WARN.
573
574 2008-07-31 Jakub Jelinek <jakub@redhat.com>
575
576 PR preprocessor/36649
577 * files.c (struct report_missing_guard_data): New type.
578 (report_missing_guard): Put paths into an array instead of printing
579 them right away. Return 1 rather than 0.
580 (report_missing_guard_cmp): New function.
581 (_cpp_report_missing_guards): Sort and print paths gathered by
582 report_missing_guard callback.
583
584 2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
585
586 PR 28079
587 * directives.c (strtolinenum): Handle overflow.
588 (do_line): Give a warning if line number overflowed.
589 (do_linemarker): Update call to strtolinenum.
590
591 2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
592
593 * include/line-map.h (linenum_type): New typedef.
594 (struct line_map): Use it.
595 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
596 (SOURCE_COLUMN): Likewise.
597 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
598 source_location values in a variable of type linenum_type.
599 * directives.c (struct if_stack): Use linenum_type.
600 (strtoul_for_line): Rename as strtolinenum.
601 (do_line): Use linenum_type.
602 (do_linemarker): Use linenum_type and strtolinenum.
603 (_cpp_do_file_change): Use linenum_t.
604 * line-map.c (linemap_add): Likewise.
605 (linemap_line_start): Likewise.
606 * traditional.c (struct fun_macro): 'line' is a source_location.
607 * errors.c (print_location): Use linenum_type.
608 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
609 * internal.h (CPP_INCREMENT_LINE): Likewise.
610 * lex.c (_cpp_skip_block_comment): Use source_location.
611
612 2008-07-14 Ben Elliston <bje@au.ibm.com>
613
614 * include/cpplib.h (NODE_CONDITIONAL): New.
615 (struct cpp_callbacks): New macro_to_expand field.
616 (struct cpp_hashnode): Adjust size of flags and type fields.
617 (cpp_peek_token): Prototype.
618 * lex.c (cpp_peek_token): New function.
619 (_cpp_temp_token): Protect pre-existing lookaheads.
620 * macro.c (cpp_get_token): Expand any conditional macros.
621 (_cpp_backup_tokens_direct): New.
622 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
623 (warn_of_redefinition): Silently allow redefined conditional
624 macros.
625 (_cpp_create_definition): Remove the conditional flag when a user
626 defines one of the conditional macros.
627 * internal.h (_cpp_backup_tokens_direct): New prototype.
628
629 2008-06-13 Andrew Haley <aph@redhat.com>
630
631 PR preprocessor/33305
632 * macro.c (replace_args): Print a warning for empty macro
633 arguments in C89 and C++.
634
635 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
636
637 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
638 * configure: Regenerate.
639
640 2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
641
642 * Makefile.in (datarootdir): New variable.
643
644 2008-06-12 H.J. Lu <hongjiu.lu@intel.com>
645
646 PR preprocessor/36479
647 * charset.c (cpp_interpret_string_notranslate): Also set
648 narrow_cset_desc.width.
649
650 2008-06-07 Joseph Myers <joseph@codesourcery.com>
651
652 * configure.ac (parisc*64*-*-*): Remove.
653 * configure: Regenerate.
654
655 2008-05-30 Tom Tromey <tromey@redhat.com>
656
657 PR preprocessor/36320:
658 * internal.h (_cpp_parse_expr): Update.
659 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
660 messages.
661 * directives.c (do_if): Update.
662 (do_elif): Require expression if processing group.
663
664 2008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
665
666 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
667
668 2008-05-21 Tom Tromey <tromey@redhat.com>
669
670 PR preprocessor/27777:
671 * lex.c (cpp_output_line_to_string): New function.
672 * internal.h (_cpp_begin_message): Don't declare.
673 * errors.c (_cpp_begin_message): Now static.
674 * include/cpplib.h (cpp_output_line_to_string): Declare.
675 * directives.c (do_diagnostic): Rewrote. Use
676 cpp_output_line_to_string. Don't use _cpp_begin_message.
677
678 2008-05-21 Tom Tromey <tromey@redhat.com>
679
680 * include/symtab.h (HT_ALLOCED): Remove.
681 (ht_purge): Declare.
682 * symtab.c (DELETED): New define.
683 (ht_lookup): Update comment.
684 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
685 code. Use subobject allocator for strings, if it exists.
686 (ht_expand): Handle deleted entries.
687 (ht_forall): Likewise.
688 (ht_purge): New function.
689 (ht_dump_statistics): Print deletion statistics.
690
691 2008-05-13 Tom Tromey <tromey@redhat.com>
692
693 PR preprocessor/22168:
694 * include/cpplib.h (struct cpp_options) <objc>: Update
695 documentation.
696 * expr.c (eval_token): Warn for use of assertions.
697 * directives.c (directive_diagnostics): Warn about extensions.
698 (DEPRECATED): New define.
699 (DIRECTIVE_TABLE): Use it.
700
701 2008-05-06 Tom Tromey <tromey@redhat.com>
702
703 PR preprocessor/35313, PR preprocessor/36088:
704 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
705 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
706
707 2008-05-04 David S. Miller <davem@davemloft.net>
708
709 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
710 * configure: Regenerate.
711
712 2008-04-22 Daniel Franke <franke.daniel@gmail.com>
713
714 * include/cpplib.h (cpp_define_formatted): New.
715 * directives.c (cpp_define_formatted): New.
716
717 2008-04-21 Tom Tromey <tromey@redhat.com>
718
719 PR libcpp/33415:
720 * charset.c (_cpp_convert_input): Add buffer_start argument.
721 Ignore UTF-8 BOM if seen.
722 * internal.h (_cpp_convert_input): Add argument.
723 * files.c (struct _cpp_file) <buffer_start>: New field.
724 (destroy_cpp_file): Free buffer_start, not buffer.
725 (_cpp_pop_file_buffer): Likewise.
726 (read_file_guts): Update.
727
728 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
729
730 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
731 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
732 (struct cpp_options): Added uliterals.
733 (cpp_interpret_string): Update prototype.
734 (cpp_interpret_string_notranslate): Idem.
735 * charset.c (init_iconv_desc): New width member in cset_converter.
736 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
737 (convert_ucn): Idem.
738 (emit_numeric_escape): Idem.
739 (convert_hex): Idem.
740 (convert_oct): Idem.
741 (convert_escape): Idem.
742 (converter_for_type): New function.
743 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
744 (cpp_interpret_string_notranslate): Match changed prototype.
745 (wide_str_to_charconst): Use converter_for_type.
746 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
747 * directives.c (linemarker_dir): Macro U changed to UC.
748 (parse_include): Idem.
749 (register_pragma_1): Idem.
750 (restore_registered_pragmas): Idem.
751 (get__Pragma_string): Support CPP_STRING{16,32}.
752 * expr.c (eval_token): Support CPP_CHAR{16,32}.
753 * init.c (struct lang_flags): Added uliterals.
754 (lang_defaults): Idem.
755 * internal.h (struct cset_converter) <width>: New field.
756 (struct cpp_reader) <char16_cset_desc>: Idem.
757 (struct cpp_reader) <char32_cset_desc>: Idem.
758 * lex.c (digraph_spellings): Macro U changed to UC.
759 (OP, TK): Idem.
760 (lex_string): Add support for u'...', U'...', u"..." and U"...".
761 (_cpp_lex_direct): Idem.
762 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
763 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
764
765 2008-04-18 Paolo Bonzini <bonzini@gnu.org>
766
767 PR bootstrap/35457
768 * aclocal.m4: Regenerate.
769 * configure: Regenerate.
770
771 2008-04-17 Tom Tromey <tromey@redhat.com>
772
773 PR libcpp/34866:
774 * errors.c (cpp_error): Don't reference a token before the start
775 of the current run.
776
777 2008-04-16 Tom Tromey <tromey@redhat.com>
778
779 * Makefile.in (TAGS_SOURCES): New variable.
780 (TAGS): New target.
781
782 2008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
783
784 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
785 and shbe-*-*.
786 * configure: Rebuilt.
787
788 2008-04-02 Joseph Myers <joseph@codesourcery.com>
789
790 * include/cpplib.h (struct cpp_callbacks): Add used_define,
791 used_undef and before_define.
792 (NODE_USED): Define.
793 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
794 do_ifndef, cpp_pop_definition): Handle new flag and use new
795 callbacks.
796 * expr.c (parse_defined): Handle new flag and use new callbacks.
797 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
798 flag and use new callbacks.
799
800 2008-04-01 Jakub Jelinek <jakub@redhat.com>
801
802 PR pch/13675
803 * files.c (struct _cpp_file): Remove pch field.
804 (pch_open_file): Don't set file->pch, just file->pchname.
805 (should_stack_file): After pfile->cb.read_pch call
806 free pchname and clear pchname, don't close file->fd.
807 Test file->pchname instead of file->pch. Don't close fd after cb.
808 (_cpp_stack_include): Test file->pchname instead of file->pch.
809
810 2008-03-28 Tom Tromey <tromey@redhat.com>
811
812 * Makefile.in (POSTCOMPILE): New variable.
813 (.c.o): Use it.
814
815 2008-03-13 Tom Tromey <tromey@redhat.com>
816
817 PR libcpp/35322:
818 * directives.c (destringize_and_run): Set pfile->directive.
819
820 2008-03-06 Markus Milleder <markus.milleder@generali.at>
821
822 PR preprocessor/35458
823 * mkdeps.c (munge): Quote '#' with a '\'.
824
825 2008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
826
827 PR preprocessor/35379
828 * mkdeps.c (deps_write): Ensure the first target always appears
829 in the first column, without leading backslash newline. Avoid
830 some more extra whitespace.
831
832 2008-02-25 Thiemo Seufer <ths@mips.com>
833
834 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
835
836 2008-02-19 Tom Tromey <tromey@redhat.com>
837
838 * traditional.c (lex_identifier): Use CPP_HASHNODE.
839 * lex.c (lex_identifier): Use CPP_HASHNODE.
840 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
841 do-while.
842 * identifiers.c (alloc_node): Change return type.
843 (_cpp_init_hashtable): Don't cast 'alloc_node'.
844 (proxy_assertion_broken): New declaration.
845 (cpp_forall_identifiers): Move comment.
846 * line-map.c (linemap_add): Comment fix.
847 (linemap_line_start): Indentation fix.
848
849 2008-01-25 Jakub Jelinek <jakub@redhat.com>
850
851 PR preprocessor/34692
852 * macro.c (collect_args): Add pragma_buff argument. Push
853 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
854 than into arguments. Reset prevent_expansion and parsing_args
855 state at CPP_PRAGMA_EOL/CPP_EOF.
856 (funlike_invocation_p): Add pragma_buff argument, pass it through
857 to collect_args.
858 (enter_macro_context): Add result argument. Adjust
859 funlike_invocation_p caller. Emit all deferred pragma tokens
860 gathered during collect_args before the expansion, add a padding
861 token. Return 2 instead of 1 if any pragma tokens were prepended.
862 (cpp_get_token): If enter_macro_context returns 2, don't return
863 a padding token, instead cycle to grab CPP_PRAGMA token.
864 * directives.c (_cpp_handle_directive): If was_parsing_args
865 in deferred pragma, leave parsing_args and prevent_expansion as is.
866
867 2008-01-22 Tom Tromey <tromey@redhat.com>
868
869 PR c++/34859
870 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
871 __STDC_CONSTANT_MACROS.
872
873 2008-01-07 Fred Fish <fnf@specifix.com>
874
875 PR preprocessor/30363
876 * traditional.c (replace_args_and_push): Add local variable
877 cxtquote, calculate the replacement text size assuming a
878 worst case of every input character quoted with backslash,
879 and properly handle output quoting of quote characters in
880 actual arguments used in function-like macros.
881
882 2008-01-03 Tom Tromey <tromey@redhat.com>
883
884 PR preprocessor/34602
885 * directives.c (do_line): Don't try to spell EOF token.
886 (do_linemarker): Add comment.
887
888 2007-12-11 DJ Delorie <dj@redhat.com>
889
890 * charset.c (convert_using_iconv): Close out any shift states,
891 returning to the initial state.
892
893 2007-12-06 Tom Tromey <tromey@redhat.com>
894
895 PR c/29172
896 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
897 type.
898 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
899 * files.c (FILE_HASH_POOL_SIZE): New macro.
900 (struct file_hash_entry_pool): New.
901 (destroy_all_cpp_files): New function.
902 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
903 (new_file_hash_entry): Update.
904 (free_file_hash_entries): New function.
905 (_cpp_cleanup_files): Call free_file_hash_entries and
906 destroy_all_cpp_files.
907 (cpp_clear_file_cache): New function.
908 * include/cpplib.h (cpp_clear_file_cache): Declare.
909
910 2007-12-03 Tom Tromey <tromey@redhat.com>
911
912 PR preprocessor/34288
913 * configure.ac, config.in: Rebuilt.
914 * configure.ac: Check for ssize_t.
915
916 2007-11-30 Tom Tromey <tromey@redhat.com>
917
918 PR preprocessor/32868
919 * macro.c (_cpp_create_definition): Special case
920 __STDC_FORMAT_MACROS.
921
922 2007-11-16 Michael Matz <matz@suse.de>
923
924 * files.c (search_path_head): Fix check for absolute paths.
925
926 2007-11-11 Tom Tromey <tromey@redhat.com>
927
928 PR c++/17557
929 * include/cpplib.h (cpp_included_before): Declare.
930 * files.c (struct file_hash_entry) <location>: New field.
931 (_cpp_find_file): Initialize new field.
932 (make_cpp_dir): Likewise.
933 (cpp_included_before): New function.
934
935 2007-11-01 Tom Tromey <tromey@redhat.com>
936
937 PR preprocessor/30805
938 * macro.c (paste_tokens): Handle padding token.
939 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
940
941 2007-10-31 Tom Tromey <tromey@redhat.com>
942
943 PR preprocessor/30786
944 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
945 * directives.c (_cpp_do__Pragma): Return error status.
946 * internal.h (_cpp_do__Pragma): Update.
947 * directives.c (get__Pragma_string): Back up if EOF seen.
948
949 2007-09-06 Tom Tromey <tromey@redhat.com>
950
951 * internal.h (struct cpp_reader) <invocation_location>: New
952 field.
953 (struct cpp_reader) <set_invocation_location>: Likewise.
954 * init.c (cpp_set_line_map): New function.
955 * line-map.c (linemap_add): Use linemap's allocator.
956 * include/line-map.h (GTY): Define.
957 (line_map_realloc): New typedef.
958 (struct line_map): Mark with GTY.
959 (struct line_maps): Likewise.
960 (struct line_maps) <maps>: Likewise.
961 (struct line_maps) <reallocator>: New field.
962 * include/symtab.h (GTY): Conditionally define.
963 * include/cpplib.h (cpp_set_line_map): Declare.
964 (cpp_get_token_with_location): Declare.
965 * macro.c (cpp_get_token): Set invocation_location on the reader.
966 (cpp_get_token_with_location): New function.
967
968 2007-08-30 Chao-ying Fu <fu@mips.com>
969
970 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
971 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
972 (cpp_classify_number): Support decimal fixed-point constants without
973 exponents.
974 Warn about fixed-point constants when -pedantic.
975 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
976 comments to support fixed-point values.
977 (CPP_N_FRACT, CPP_N_ACCUM): Define.
978
979 2007-08-18 Tom Tromey <tromey@redhat.com>
980
981 PR preprocessor/32974
982 * directives.c (parse_include): Don't check for EOL when
983 processing #pragma dependency.
984
985 2007-07-30 Ollie Wild <aaw@google.com>
986
987 * directives-only.c: New file.
988 * internal.h (struct _cpp_dir_only_callbacks): New.
989 (_cpp_preprocess_dir_only): New function.
990 * directives.c (_cpp_handle_directive): Check directives_only before
991 disabling execution of indented directives.
992 * files.c (_cpp_stack_file): Add directives_only check.
993 * include/cpplib.h (struct cpp_options): Add directives_only.
994 (cpp_init_special_builtins): New function.
995 * init.c (cpp_init_special_builtins): New function.
996 (cpp_init_builtins): Move builtin_array initialization to
997 cpp_init_special_builtins.
998 (post_options): Check directives_only before setting
999 pfile->state.prevent_expansion = 1.
1000 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
1001 is expanded inside a directive while -fdirectives-only is enabled.
1002 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
1003 (libcpp_a_SOURCES): Add directives-only.c.
1004
1005 2007-07-04 Uros Bizjak <ubizjak@gmail.com>
1006
1007 * traditional.c (_cpp_scan_out_logical_line): Initialize
1008 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
1009 fmacro.args to prevent 'may be used uninitialized' warning.
1010
1011 2007-07-03 Uros Bizjak <ubizjak@gmail.com>
1012
1013 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
1014 Add new constants.
1015 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
1016 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
1017 for 'q' or 'Q' suffixes.
1018
1019 2007-06-17 Danny Smith <dannysmith@users.sourceforge.net
1020
1021 * files.c (open_file): Correct typo.
1022
1023 2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
1024
1025 * files.c (open_file): Prevent the call
1026 for stat from overwriting errno.
1027
1028 2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
1029
1030 * files.c (open_file): Account for the
1031 fact that on windows, opening a directory gives
1032 EACCES.
1033
1034 2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
1035
1036 PR preprocessor/23479
1037 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
1038 integer constants.
1039 (append_digit): Likewise.
1040 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
1041 binary integer constants.
1042
1043 2007-05-31 Dave Korn <dave.korn@artimi.com>
1044
1045 PR preprocessor/14331
1046 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
1047
1048 2007-05-24 Ollie Wild <aaw@google.com>
1049
1050 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
1051 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
1052 (cpp_write_pch_state): Save __COUNTER__ state.
1053 (cpp_valid_state): Check valid __COUNTER__ state.
1054 (cpp_read_state): Read new __COUNTER__ state.
1055 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
1056 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
1057 * internal.h (struct cpp_reader): Add counter member.
1058
1059 2007-05-23 Simon Martin <simartin@users.sourceforge.net>
1060
1061 PR preprocessor/20077
1062 * macro.c (create_iso_definition): Fixed the method to determine
1063 whether the token-pasting operator appears at the beginning or the end
1064 of a macro.
1065
1066 2007-05-21 Ian Lance Taylor <iant@google.com>
1067
1068 * internal.h (struct cpp_reader): Add new fields:
1069 nonexistent_file_hash and nonexistent_file_ob.
1070 * files.c: Include "obstack.h".
1071 (find_file_in_dir): Before trying to open the file, look up the
1072 path name in the hash table of nonexistent files. After failing
1073 to open the file, add the path name to the hash table.
1074 (_cpp_find_file): Cache the results of looking up the file name
1075 starting with the quote and bracket chain heads, if we can.
1076 (nonexistent_file_hash_eq): New static function.
1077 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
1078 pfile->nonexistent_file_ob.
1079 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
1080 pfile->nonexistent_file_ob.
1081
1082 2007-05-14 Janis Johnson <janis187@us.ibm.com>
1083
1084 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
1085
1086 PR c/31924
1087 * expr.c (interpret_float_suffix): Check for invalid suffix.
1088
1089 2007-05-02 Eric Christopher <echristo@apple.com>
1090
1091 * expr.c (num_div_op): Don't overflow if the result is
1092 zero.
1093
1094 2007-05-02 Tom Tromey <tromey@redhat.com>
1095
1096 PR preprocessor/28709
1097 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
1098
1099 2007-03-30 Michael Meissner <michael.meissner@amd.com>
1100
1101 * directives.c (lex_macro_node_from_str): Fix alloca call to be
1102 type correct.
1103
1104 2007-03-30 Richard Henderson <rth@redhat.com>
1105
1106 * directives.c (lex_macro_node_from_str): New.
1107 (cpp_push_definition, cpp_pop_definition): New.
1108 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
1109
1110 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1111
1112 * Makefile.in: Add dummy install-pdf target.
1113
1114 2007-01-30 Tom Tromey <tromey@redhat.com>
1115
1116 PR preprocessor/30468
1117 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
1118 './'.
1119
1120 2007-01-30 Tom Tromey <tromey@redhat.com>
1121
1122 PR preprocessor/29966
1123 * macro.c (lex_expansion_token): Save and restore cpp_reader's
1124 cur_token.
1125 (_cpp_create_definition): Don't restore cur_token here.
1126 * lex.c (_cpp_lex_token): Added assertion.
1127
1128 2007-01-27 Tom Tromey <tromey@redhat.com>
1129
1130 * configure: Rebuilt.
1131
1132 2007-01-12 Tom Tromey <tromey@redhat.com>
1133
1134 PR preprocessor/28227
1135 * directives.c (lex_macro_node): Added 'is_def_or_undef'
1136 argument.
1137 (do_define): Update.
1138 (do_undef): Update.
1139 (do_ifdef): Update.
1140 (do_ifndef): Update.
1141
1142 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
1143
1144 * configure: Regenerate.
1145
1146 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
1147
1148 * configure: Regenerate.
1149
1150 2007-01-04 Tom Tromey <tromey@redhat.com>
1151
1152 PR preprocessor/28165
1153 * internal.h (cpp_in_primary_file): New function.
1154 * directives.c (do_include_next): Use cpp_in_primary_file.
1155 (do_pragma_once): Likewise.
1156 (do_pragma_system_header): Likewise.
1157
1158 2006-12-29 Ian Lance Taylor <iant@google.com>
1159
1160 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
1161 look backward at the end of the line unless we saw a backslash.
1162
1163 2006-12-29 Jakub Jelinek <jakub@redhat.com>
1164
1165 PR preprocessor/29612
1166 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
1167 only when new_sysp is non-zero.
1168
1169 2006-12-28 Tom Tromey <tromey@redhat.com>
1170
1171 PR preprocessor/30001
1172 * charset.c (_cpp_convert_input): Check that to.len is greater
1173 than zero.
1174
1175 2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
1176
1177 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
1178 * configure: Rebuilt.
1179
1180 2006-11-01 Douglas Gregor <doug.gregor@gmail.com>
1181
1182 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
1183 for experimental C++0x mode.
1184 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
1185 adopted the preprocessor changes introduced in C99.
1186
1187 2006-10-29 Joseph Myers <joseph@codesourcery.com>
1188
1189 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
1190 depending on --enable-targets=all.
1191 * configure: Regenerate.
1192
1193 2006-10-12 Jakub Jelinek <jakub@redhat.com>
1194
1195 PR preprocessor/28709
1196 * macro.c (paste_tokens): Do error reporting here, use BUF with the
1197 spelled LHS token as opposed to spelling it again.
1198 (paste_all_tokens): Don't report errors here, just break on failure.
1199
1200 2006-10-10 Brooks Moses <bmoses@stanford.edu>
1201
1202 * Makefile.in: Added empty "pdf" target.
1203
1204 2006-09-22 Geoffrey Keating <geoffk@apple.com>
1205
1206 * configure.ac: Make need_64_bit_hwint case for x86-darwin
1207 match exactly the glob in gcc/config.gcc.
1208 * configure: Regenerate.
1209
1210 2006-09-13 Joseph S. Myers <joseph@codesourcery.com>
1211
1212 PR c/28768
1213 PR preprocessor/14634
1214 * lex.c (lex_string): Pedwarn for unterminated literals.
1215
1216 2006-09-08 Eric Christopher <echristo@apple.com>
1217
1218 * configure.ac: Add 64-bit HWI support for i?86-darwin.
1219
1220 2006-08-14 Steve Ellcey <sje@cup.hp.com>
1221
1222 PR c++/28288
1223 PR c++/14556
1224 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
1225 (CPP_LAST_EQ): Change.
1226 (CPP_LAST_PUNCTUATOR): Change.
1227 * expr.c (cpp_operator): Remove MIN and MAX.
1228 (reduce): Remove CPP_MIN and CPP_MAX.
1229 (num_binary_op): Ditto.
1230 * lex.c (_cpp_lex_direct): Ditto.
1231 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
1232
1233 2006-06-09 Jakub Jelinek <jakub@redhat.com>
1234
1235 PR preprocessor/27746
1236 * directives.c (do_pragma): Handle pragma with valid namespace
1237 and invalid name coming from macro expansion.
1238 * directives.c (destringize_and_run): Initialize next field in
1239 context.
1240
1241 PR c/27747
1242 PR c++/27748
1243 * directives.c (destringize_and_run): Set NO_EXPAND on the
1244 tokens.
1245
1246 * macro.c (_cpp_backup_tokens): Fix comment typo.
1247
1248 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
1249
1250 * Makefile.in (CATALOGS): Add po/ prefix.
1251 * configure: Regenerated.
1252
1253 2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
1254
1255 * Makefile.in: Add install-html target. Add install-html to .PHONY
1256
1257 2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
1258
1259 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
1260 * files.c (_cpp_get_file_stat): New function.
1261 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
1262 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
1263 * internal.h (_cpp_get_file_stat): Prototype.
1264 (struct cpp_buffer): Add timestamp.
1265
1266 2006-01-23 Jakub Jelinek <jakub@redhat.com>
1267
1268 PR preprocessor/25717
1269 * init.c (cpp_init_builtins): If __STDC__ will not change value
1270 between system headers and other sources, define it as a normal
1271 macro rather than a builtin.
1272 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
1273 cpp_in_system_header condition.
1274
1275 2006-01-05 Paolo Bonzini <bonzini@gnu.org>
1276
1277 * Makefile.in: Use -MMD instead of -MD.
1278
1279 2006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
1280 Richard Henderson <rth@redhat.com>
1281
1282 Merge from gomp branch:
1283 * directives.c (struct pragma_entry): Add is_deferred. Add ident
1284 entry to value union.
1285 (end_directive): Don't eat the line if in_deferred_pragma.
1286 (run_directive): Remove pragma hacks.
1287 (insert_pragma_entry): Remove.
1288 (new_pragma_entry): New.
1289 (register_pragma_1): Split out of register_pragma. Only handle
1290 the lookup tree and return the new entry.
1291 (cpp_register_pragma): Fill in the pragma entry here.
1292 (cpp_register_deferred_pragma): New.
1293 (register_pragma_internal): New.
1294 (_cpp_init_internal_pragmas): Use register_pragma_internal.
1295 (do_pragma): Allow pragma expansion after namespace. For deferred
1296 pragmas, don't slurp the line into a string.
1297 (destringize_and_run): Save tokens for deferred pragmas.
1298 (cpp_handle_deferred_pragma): Remove.
1299 * macro.c (builtin_macro): Remove pragma token hack.
1300 (_cpp_push_token_context): Rename from push_token_context and export.
1301 * internal.h (struct lexer_state): Add pragma_allow_expansion.
1302 (_cpp_push_token_context): Declare.
1303 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
1304 a token. Update the line number correctly if so.
1305 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
1306 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
1307 * include/cpplib.h (PRAGMA_EOL): New.
1308 (CPP_TOKEN_FLD_PRAGMA): New.
1309 (struct cpp_token): Add val.pragma.
1310 (struct cpp_options): Remove defer_pragmas.
1311 (cpp_handle_deferred_pragma): Remove.
1312 (cpp_register_deferred_pragma): Declare.
1313
1314 2006-01-01 Jakub Jelinek <jakub@redhat.com>
1315
1316 PR c++/25294
1317 * directives.c (do_pragma): If pragma line ends with multi-line
1318 block comment, end the saved deferred pragma string before that
1319 comment. Handle embedded '\0' chars on the pragma line.
1320
1321 2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
1322
1323 PR c++/23333
1324 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
1325
1326 2005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
1327 Ben Elliston <bje@au.ibm.com>
1328
1329 * include/cpplib.h (CPP_N_DFLOAT): New.
1330 * expr.c (interpret_float_suffix): Identify df, dd, and dl
1331 suffixes as decimal floating point constants.
1332 (cpp_classify_number): Disallow hexadecimal DFP constants.
1333
1334 2005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
1335 Ian Lance Taylor <ian@airs.com>
1336
1337 * include/cpplib.h (struct cpp_callbacks): Annotate error with
1338 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
1339
1340 2005-11-09 Per Bothner <per@bothner.com>
1341 Uros Bizjak <uros@kss-loka.si>
1342
1343 PR c/24101
1344 * init.c (read_original_filename): Temporarily set
1345 state.in_directive before calling _cpp_lex_direct for
1346 CPP_HASH tokens.
1347
1348 2005-11-03 James E Wilson <wilson@specifix.com>
1349
1350 PR preprocessor/24202
1351 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
1352
1353 2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
1354
1355 * include/cpplib.h (struct cpp_callbacks): Make error take
1356 va_list* parameter.
1357 * errors.c (cpp_error): Update call to callback.
1358
1359 2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
1360
1361 PR preprocessor/22042
1362 * macro.c (_cpp_builtin_macro_text): Lower the needed max
1363 buffer size.
1364 (cpp_quote_string): Don't octalify non printable
1365 charactors.
1366
1367 2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
1368
1369 PR c++/17964
1370 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
1371 (struct cpp_callbacks): Add error.
1372 * errors.c (cpp_error): If client_diagnostic, use error callback.
1373 * charset.c (convert_escape): Don't use %03o in diagnostic.
1374
1375 2005-10-21 James E Wilson <wilson@specifix.com>
1376
1377 PR preprocessor/15220
1378 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
1379 callers. Pass to open_file_failed.
1380 (open_file_failed): New parameter angle_brackets. Fix all callers.
1381 Use in print_dep assignment.
1382 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
1383 * internal.h (_cpp_find_file): Add new parm to declaration.
1384
1385 2005-10-08 Kazu Hirata <kazu@codesourcery.com>
1386
1387 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
1388 * configure: Regenerate.
1389
1390 2005-10-04 Ian Lance Taylor <ian@airs.com>
1391
1392 PR preprocessor/13726
1393 * directives.c (check_eol_return_comments): New static function.
1394 (parse_include): Add buf parameter. Change all callers.
1395 (do_include_common): If not discard comments, turn on
1396 save_comments. Pass collected comments to include callback.
1397 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
1398 include callback: cpp_token list.
1399
1400 2005-09-20 Joseph S. Myers <joseph@codesourcery.com>
1401
1402 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
1403 * init.c (struct lang_flags, lang_defaults): Add
1404 extended_identifiers.
1405 (cpp_set_lang): Use it.
1406 * lex.c (forms_identifier_p): Check extended_identifiers.
1407
1408 2005-08-30 Jakub Jelinek <jakub@redhat.com>
1409
1410 PR preprocessor/20348
1411 PR preprocessor/20356
1412 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
1413 2004-06-05 changes.
1414
1415 2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1416
1417 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
1418 -Wmissing-format-attribute.
1419
1420 * configure: Regenerate.
1421
1422 2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
1423
1424 * all files: Update FSF address in copyright headers.
1425 * makeucnid.c (write_copyright): Update outputted FSF address.
1426
1427 2005-06-13 Zack Weinberg <zack@codesourcery.com>
1428
1429 * configure.ac: Invoke ZW_CREATE_DEPDIR and
1430 ZW_PROG_COMPILER_DEPENDENCIES.
1431 * aclocal.m4, configure: Regenerate.
1432 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
1433 New variables.
1434 (distclean): Clean up $(DEPDIR) and its contents.
1435 (.c.o): Use $(COMPILE).
1436 Include $(DEPDIR)/*.Po for most object->header dependencies.
1437
1438 2005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1439
1440 * configure.ac: Check declarations for asprintf and vasprintf.
1441 * config.in: Regenerate.
1442 * configure: Likewise.
1443
1444 * charset.c (conversion_loop): Use XRESIZEVEC.
1445 (convert_no_conversion): Likewise.
1446 (convert_using_iconv): Likewise.
1447 (init_iconv_desc): Cast return value of alloca.
1448 (cpp_host_to_exec_charset): Use XNEWVEC.
1449 (emit_numeric_escape): Use XRESIZEVEC.
1450 (cpp_interpret_string): Use XNEWVEC.
1451 (cpp_interpret_string): Use XRESIZEVEC.
1452 (_cpp_interpret_identifier): Cast return value of alloca.
1453 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
1454 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
1455 (parse_include): Use XNEWVEC.
1456 (insert_pragma_entry): Rename local variable "new" to
1457 "new_entry".
1458 (save_registered_pragmas): Cast return value of xmemdup.
1459 (destringize_and_run): Same for alloca.
1460 (parse_assertion): Likewise.
1461 (do_assert): Cast allocated storage to proper type.
1462 (cpp_define): Likewise.
1463 (_cpp_define_builtin): Likewise.
1464 (cpp_undef): Likewise.
1465 (handle_assertion): Likewise.
1466 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
1467 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
1468 (CPP_UMINUS): Likewise.
1469 (struct cpp_operator): Rename from struct operator.
1470 (_cpp_expand_op_stack): Use XRESIZEVEC.
1471 * files.c (pch_open_file): Use XNEWVEC.
1472 (pch_open_file): Use XRESIZEVEC.
1473 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
1474 (dir_name_of_file): Use XNEWVEC.
1475 (make_cpp_file): Use XCNEW.
1476 (make_cpp_dir): Likewise.
1477 (allocate_file_hash_entries): USE XNEWVEC.
1478 (cpp_included): Cast return value of htab_find_with_hash.
1479 (append_file_to_dir): Use XNEWVEC.
1480 (read_filename_string): Likewise. Use XRESIZEVEC too.
1481 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
1482 (remap_filename): Use XNEWVEC.
1483 (struct pchf_entry): Move definition out of struct pchf_data.
1484 (_cpp_save_file_entries): Use XCNEWVAR.
1485 (_cpp_read_file_entries): Use XNEWVAR.
1486 * identifiers.c (alloc_node): Use XOBNEW.
1487 * init.c (cpp_create_reader): Use XCNEW.
1488 (cpp_init_builtins): Cast of b->value to enum builtin_type.
1489 (read_original_directory): Cast return value of alloca.
1490 * lex.c (add_line_note): Use XRESIZEVEC.
1491 (warn_about_normalization): Use XNEWVEC.
1492 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
1493 (new_buff): Use XNEWVEC.
1494 * line-map.c (linemap_add): Use XRESIZEVEC.
1495 * macro.c (builtin_macro): Cast return value of alloca.
1496 (paste_tokens): Likewise.
1497 (expand_arg): Use XNEWVEC and XRESIZEVEC.
1498 (_cpp_save_parameter): Use XRESIZEVEC.
1499 (create_iso_definition): Cast allocated storage to proper type.
1500 (_cpp_create_definition): Likewise.
1501 (cpp_macro_definition): Use XRESIZEVEC.
1502 * makedepend.c (add_clm): Use XNEW.
1503 (add_dir): Likewise.
1504 * mkdeps.c (munge): Use XNEWVEC.
1505 (deps_init): Use XCNEW.
1506 (deps_add_target): Use XRESIZEVEC.
1507 (deps_add_default_target): Cast return value of alloca.
1508 (deps_add_dep): Use XRESIZEVEC.
1509 (deps_add_vpath): Likewise. Use XNEWVEC too.
1510 (deps_restore): Likewise.
1511 * pch.c (save_idents): Use XNEW and XNEWVEC.
1512 (cpp_save_state): Use XNEW.
1513 (count_defs): Cast return value of htab_find.
1514 (write_defs): Likewise.
1515 (cpp_write_pch_deps): Use XNEWVEC.
1516 (collect_ht_nodes): Use XRESIZEVEC.
1517 (cpp_valid_state): Use XNEWVEC.
1518 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
1519 * symtab.c (ht_create): Use XCNEW.
1520 (ht_lookup_with_hash): Cast return value of obstack_copy0.
1521 (ht_expand): Use XCNEWVEC.
1522 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
1523 (bool): Do not define if __cplusplus.
1524
1525 2005-05-12 Zack Weinberg <zack@codesourcery.com>
1526
1527 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
1528 (do_sccs): Delete function definition, #define to do_ident.
1529 (do_ident): Don't hardwire directive name.
1530
1531 2005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
1532
1533 PR bootstrap/21230
1534 * configure: Regenerate.
1535
1536 2005-04-27 Andris Pavenis <pavenis@latnet.lv>
1537
1538 * files.c: Include io.h for DJGPP to get prototype of setmode.
1539
1540 2005-04-19 Per Bothner <per@bothner.com>
1541
1542 PR preprocessor/20907
1543 * line-map.c (linemap_line_start): Fix bug when we need to increse
1544 column_bits but can re-use the current line_map.
1545
1546 2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1547
1548 * system.h (fopen, fdopen, freopen): Define these to the unlocked
1549 libiberty functions.
1550
1551 2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1552
1553 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
1554 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
1555 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
1556 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
1557 _unlocked function.
1558 (fwrite_unlocked): Fix prototype.
1559
1560 * configure, config.in: Regenerate.
1561
1562 2005-04-05 Jakub Jelinek <jakub@redhat.com>
1563
1564 PR preprocessor/19475
1565 * macro.c (create_iso_definition): For < ISO C99, don't
1566 pedwarn if there is no whitespace between macro name and its
1567 replacement, but the replacement starts with a basic character
1568 set character.
1569
1570 2005-03-28 Andreas Jaeger <aj@suse.de>
1571
1572 * lex.c (warn_about_normalization): Cast field width to int to
1573 avoid warning.
1574
1575 2005-03-19 Joseph S. Myers <joseph@codesourcery.com>
1576
1577 * configure.ac: Consistently use solaris2.1[0-9]* instead of
1578 solaris2.1[0-9].
1579 * configure: Regenerate.
1580
1581 2005-03-15 Geoffrey Keating <geoffk@apple.com>
1582
1583 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
1584 UCN rather than printing an error.
1585
1586 2005-03-14 Geoffrey Keating <geoffk@apple.com>
1587
1588 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
1589
1590 2005-03-14 Geoffrey Keating <geoffk@apple.com>
1591
1592 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
1593 * charset.c: Update for new format of ucnid.h.
1594 (ucn_valid_in_identifier): Update for new format of ucnid.h.
1595 Add NST parameter, and update it; update callers.
1596 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
1597 with cpp_error.
1598 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
1599 * internal.h (struct normalize_state): New.
1600 (INITIAL_NORMALIZE_STATE): New.
1601 (NORMALIZE_STATE_RESULT): New.
1602 (NORMALIZE_STATE_UPDATE_IDNUM): New.
1603 (_cpp_valid_ucn): New.
1604 * lex.c (warn_about_normalization): New.
1605 (forms_identifier_p): Add normalize_state parameter, update callers.
1606 (lex_identifier): Add normalize_state parameter, update callers. Keep
1607 the state current.
1608 (lex_number): Likewise.
1609 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
1610 it with warn_about_normalization.
1611 * makeucnid.c: New.
1612 * ucnid.h: Replace.
1613 * ucnid.pl: Remove.
1614 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
1615 comments about obsolete version of C++.
1616 * include/cpplib.h (enum cpp_normalize_level): New.
1617 (struct cpp_options): Add warn_normalize field.
1618
1619 2005-03-11 Geoffrey Keating <geoffk@apple.com>
1620
1621 * directives.c (glue_header_name): Update call to cpp_spell_token.
1622 * internal.h (_cpp_interpret_identifier): New.
1623 * charset.c (_cpp_interpret_identifier): New.
1624 (_cpp_valid_ucn): Allow UCN version of '$'.
1625 * lex.c (lex_identifier): Add extra parameter to indicate if initial
1626 character was '$' or '\'. Support identifiers with UCNs.
1627 (forms_identifier_p): Allow UCNs.
1628 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
1629 (utf8_to_ucn): New.
1630 (cpp_spell_token): Add FORSTRING parameter. Use it.
1631 (cpp_token_as_text): Update call to cpp_spell_token.
1632 (cpp_output_token): Write UCNs back out.
1633 (stringify_arg): Update call to cpp_spell_token.
1634 (paste_tokens): Likewise.
1635 (cpp_macro_definition): Likewise.
1636 * macro.c (stringify_arg): Likewise.
1637 (paste_tokens): Likewise.
1638 (cpp_macro_definition): Likewise.
1639 * include/cpplib.h: Add parameter to cpp_spell_token.
1640
1641 2005-03-04 Jakub Jelinek <jakub@redhat.com>
1642
1643 PR bootstrap/20282
1644 PR bootstrap/20305
1645 * macro.c (replace_args, cpp_get_token): Copy whole
1646 cpp_token_u instead of just cpp_string field from it.
1647
1648 2005-02-28 Devang Patel <dpatel@apple.com>
1649
1650 * directives.c (do_line): Save sysp early before line table is
1651 realloc'ed.
1652
1653 2005-02-20 Zack Weinberg <zack@codesourcery.com>
1654
1655 PR 18785
1656 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
1657 (cpp_host_to_exec_charset): New function.
1658 * include/cpplib.h: Declare cpp_host_to_exec_charset.
1659
1660 2005-02-19 Devang Patel <dpatel@apple.com>
1661
1662 * charset.c (_cpp_convert_input): Check '\r' before inserting
1663 '\n' at the end.
1664
1665 2005-02-15 Eric Christopher <echristo@redhat.com>
1666
1667 PR preprocessor/19077
1668 * macro.c (cpp_macro_definition): Move handling of whitespace
1669 to PREV_WHITE conditional. Remove overloading of len
1670 variable.
1671
1672 2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
1673
1674 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
1675 traditional.c: Update copyright.
1676
1677 2005-02-14 Paolo Bonzini <bonzini@gnu.org>
1678
1679 PR bootstrap/19818
1680 * configure.ac: Check for declaration of basename and getopt.
1681 * config.in: Regenerate.
1682 * configure: Regenerate.
1683 * internal.h (ustrcspn): New.
1684 * macro.c (create_iso_definition): Fix allocation of memory.
1685 (padding_token): Add cast to remove const-ness.
1686 * pch.c (cpp_read_state): Use ustrcspn.
1687
1688 2005-02-08 Mike Stump <mrs@apple.com>
1689
1690 * files.c (pchf_adder): Remove.
1691 (struct pchf_adder_info): Likewise.
1692 (_cpp_save_file_entries): Write out all files so that #import works.
1693
1694 2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
1695
1696 * configure: Regenerate.
1697
1698 2005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
1699
1700 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
1701
1702 * include/cpplib.h: Also update copyright years.
1703
1704 2005-01-03 Geoffrey Keating <geoffk@apple.com>
1705
1706 * files.c (_cpp_find_file): Add files found by search_path_exhausted
1707 to the list of all files.
1708
1709 2005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
1710
1711 * internal.h: Update references to Cpp lib filenames.
1712 * directives.c: Likewise.
1713 * init.c: Likewise.
1714 * macro.c: Likewise.
1715 * traditional.c: Likewise.
1716
1717 2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
1718
1719 PR preprocessor/15167
1720 * files.c (destroy_cpp_file): New function.
1721 (should_stack_file): Make a new file if the
1722 compared file is still stacked.
1723
1724 2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
1725
1726 PR preprocessor/17610
1727 * directives.c (do_include_common): Error out if an empty filename
1728 is given for #include (or #include_next or #import).
1729
1730 2004-11-27 Roger Sayle <roger@eyesopen.com>
1731 Zack Weinberg <zack@codesourcery.com>
1732
1733 * internal.h: Replace all uses of uchar with unsigned char.
1734 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
1735 with !IN_GCC, so uchar is only defined whilst building libcpp.
1736
1737 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
1738
1739 * aclocal.m4: Regenerate.
1740
1741 2004-11-24 Roger Sayle <roger@eyesopen.com>
1742
1743 PR preprocessor/15824
1744 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
1745 directly, instead of the non-existant "system.h" and "ansidecl.h".
1746 * configure: Regenerate.
1747
1748 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
1749 Joseph Myers <joseph@codesourcery.com>
1750
1751 * internal.h (struct lexer_state): Add in_deferred_pragma.
1752 * directives.c (struct pragma_entry): Add allow_expansion.
1753 (insert_pragma_entry): Take allow_expansion flag.
1754 (register_pragma): Likewise.
1755 (cpp_register_pragma): Likewise.
1756 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
1757 (do_pragma): Honor allow_expansion.
1758 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
1759 * include/cpplib.h (cpp_register_pragma): Update prototype.
1760
1761 2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
1762 Mark Mitchell <mark@codesourcery.com>
1763
1764 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
1765 need_64bit_hwint=yes.
1766 * configure: Regenerate.
1767
1768 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
1769
1770 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
1771 po/$(PACKAGE).pot.
1772 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
1773 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
1774 Remove local srcdir path from generated file.
1775
1776 2004-11-04 Zack Weinberg <zack@codesourcery.com>
1777 Gerald Pfeifer <gerald@pfeifer.com>
1778
1779 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
1780 as well.
1781
1782 2004-10-27 Zack Weinberg <zack@codesourcery.com>
1783
1784 PR 18075
1785 * directives.c (do_pragma): Do not defer pragmas which are unknown.
1786 (cpp_handle_deferred_pragma): Add cast to silence warning.
1787
1788 2004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
1789
1790 * errors.c (_cpp_begin_message): Print "error: " for errors.
1791
1792 2004-10-10 Andreas Jaeger <aj@suse.de>
1793
1794 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
1795 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
1796
1797 2004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
1798
1799 * pch.c (cpp_write_pch_state): Remove variable z as it is not
1800 used.
1801 (cpp_read_state): Remove unused variables, m, d and mac_count.
1802
1803 2004-09-29 Per Bothner <per@bothner.com>
1804
1805 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
1806 cb.line_change. Otherwise do_pragma will call the line_change
1807 call-back with a meaningless line number.
1808
1809 2004-09-24 Zack Weinberg <zack@codesourcery.com>
1810
1811 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
1812 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
1813 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
1814 * aclocal.m4, configure: Regenerate.
1815 * init.c: Include localedir.h.
1816 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
1817 (DEFS): Delete.
1818 (.c.o): Use $(ALL_CFLAGS).
1819 (localedir.h, localedir.hs): New rules.
1820 (clean): Use rm -rf to remove directories.
1821 (distclean): Also delete localedir.h and localedir.hs.
1822 (init.o): Update dependencies.
1823
1824 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
1825
1826 * Makefile.in (aclocal.m4): Update dependencies.
1827 * configure.ac (AC_CONFIG_MACRO_DIR): New.
1828 * aclocal.m4, configure: Regenerate.
1829
1830 2004-09-17 Zack Weinberg <zack@codesourcery.com>
1831
1832 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
1833 (_cpp_convert_input, _cpp_default_encoding): Add comments.
1834 Some other comments in this file also tweaked.
1835
1836 * directives.c (do_pragma): Save current buffer position
1837 before lexing the pragma keywords; don't call
1838 _cpp_backup_tokens in the defer_pragmas case.
1839
1840 2004-09-15 Per Bothner <per@bothner.com>
1841
1842 * include/line-map.h (line_map_start): Add parameter names so
1843 preceding comment makes sense.
1844 (linemap_add): Remove from comment mention of non-existing parameter.
1845
1846 2004-09-09 Matt Austern <austern@apple.com>
1847 Zack Weinberg <zack@codesourcery.com>
1848
1849 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
1850 prefixes throughout. Add entry for PRAGMA. Remove
1851 unnecessary "= 0" from EQ.
1852 (enum cpp_ttype): Adjust OP and TK definitions to restore
1853 prefixes, via token-paste.
1854 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
1855 Change from #defines to additional cpp_ttype enumerators.
1856 (struct cpp_options): Add defer_pragmas.
1857 (cpp_handle_deferred_pragma): Prototype new interface.
1858
1859 * internal.h (struct cpp_reader): Add directive_result.
1860 * directives.c (struct pragma_entry): Add is_internal field;
1861 give boolean fields type bool.
1862 (start_directive): Initialize pfile->directive_result.type.
1863 (_cpp_do__Pragma): Likewise.
1864 (run_directive): Do not crash if pfile->buffer->prev is NULL.
1865 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
1866 from it.
1867 (register_pragma): New static function, bulk of former
1868 cpp_register_pragma here; add 'internal' argument, pass along
1869 to insert_pragma_entry.
1870 (cpp_register_pragma): Now a wrapper around register_pragma which
1871 always passes false for 'internal' argument.
1872 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
1873 true for 'internal'.
1874 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
1875 an internal pragma, save text till the end of the line as a CPP_PRAGMA
1876 token instead of executing the pragma.
1877 (cpp_handle_deferred_pragma): New interface.
1878 * lex.c (token_spellings): Adjust OP and TK definitions to
1879 match changes to cpplib.h.
1880 (_cpp_lex_token): Check for a directive-result token and
1881 return it if present.
1882 (cpp_token_val_index): Handle CPP_PRAGMA.
1883 * macro.c (cpp_builtin_macro_text): Correct comment.
1884 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
1885
1886 2004-09-06 Serge Belyshev <belyshev@lubercy.com>
1887
1888 PR preprocessor/14699
1889 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
1890 from size_t to double.
1891
1892 2004-08-28 Andreas Schwab <schwab@suse.de>
1893 Andreas Jaeger <aj@suse.de>
1894
1895 * configure.ac: Set PACKAGE correctly.
1896 * configure: Regenerated.
1897
1898 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
1899
1900 * Makefile.in: Add back top_builddir.
1901
1902 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
1903
1904 * configure.ac: Replace Automake macro invocations
1905 with manual Autoconf checks and substitutions.
1906 * configure: Regenerate.
1907 * aclocal.m4: Regenerate.
1908 * config.in: Regenerate.
1909 * Makefile.am: Removed.
1910 * Makefile.in: Heavy simplification and reorganization.
1911
1912 2004-08-09 Mark Mitchell <mark@codesourcery.com>
1913
1914 * configure.ac (arm*-*-eabi*): New target.
1915 (arm*-*-symbianelf*): Likewise.
1916 * configure: Regenerated.
1917
1918 2004-07-24 Bernardo Innocenti <bernie@develer.com>
1919
1920 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
1921 * directives.c: Use XNEW-family macros from libiberty.
1922 * lex.c: Likewise.
1923 * macro.c: Likewise.
1924 * cpplib.h (cpp_deps_style): Export enum with name.
1925
1926 2004-07-23 Matthias Klose <doko@debian.org>
1927
1928 * init.c (init_library): Use PACKAGE for the text domain.
1929
1930 2004-07-16 Andris Pavenis <pavenis@latnet.lv>
1931
1932 PR preprocessor/16366
1933 * internal.h (struct cpp_reader): New field dir_hash.
1934 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
1935 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
1936
1937 2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
1938
1939 PR preprocessor/16192
1940 PR preprocessor/15913
1941 PR preprocessor/15572
1942 * expr.c (_cpp_parse_expr): Handle remaining cases where an
1943 expression is missing.
1944 * init.c (post_options): Traditional cpp doesn't do // comments.
1945
1946 2004-06-30 Per Bothner <per@bothner.com>
1947
1948 * include/line-map.h (fileline): Remove old typedef.
1949 * internal.h (struct cpp_reader): Use source_location typedef instead.
1950
1951 2004-06-26 Zack Weinberg <zack@codesourcery.com>
1952
1953 Partially revert patch of 2004-06-05.
1954 * files.c (search_cache): Remove pfile argument. Don't check
1955 for file that would be found by "" or <> search here...
1956 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
1957 Do not apply directory-of-current-file correction to files
1958 found by this check. Rearrange code slightly.
1959
1960 2004-06-21 Geoffrey Keating <geoffk@apple.com>
1961
1962 * files.c (should_stack_file): Correct swapped parameters to call
1963 to cb.read_pch.
1964 * pch.c (cpp_valid_state): Handle -fpreprocessed.
1965
1966 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
1967
1968 * Makefile.in: Regenerate with automake 1.8.5.
1969 * aclocal.m4: Likewise.
1970 * configure: Regenerate.
1971
1972 2004-06-11 Zack Weinberg <zack@codesourcery.com>
1973
1974 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
1975 * configure, config.in: Regenerate.
1976 * system.h: Unconditionally define bool as unsigned char,
1977 BOOL_BITFIELD as unsigned int.
1978 * .cvsignore: New file.
1979
1980 2004-06-09 Geoffrey Keating <geoffk@apple.com>
1981
1982 * traditional.c (push_replacement_text): Set macro->traditional.
1983 (save_replacement_text): Likewise.
1984 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
1985 (struct save_macro_item): Delete.
1986 (struct save_macro_data): Use a character array not the previous
1987 structured format.
1988 (save_macros): Save macro as text not as internal structures.
1989 (cpp_prepare_state): Update for changes to save_macro_data.
1990 (cpp_read_state): Don't read macros defined in PCH. Restore
1991 -D macros as text.
1992 * macro.c (create_iso_definition): Honour alloc_subobject.
1993 Clear traditional flag.
1994 (_cpp_create_definition): Honour alloc_subobject.
1995 * lex.c (cpp_token_val_index): New.
1996 * internal.h: Include cpp-id-data.h.
1997 (uchar): Move definition to cpp-id-data.h.
1998 (U): Likewise.
1999 (cpp_macro): Likewise.
2000 * directives.c (struct answer): Move to cpp-id-data.h.
2001 (do_assert): Honour alloc_subobject.
2002
2003 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
2004 * include/cpplib.h (struct cpp_string): Add GTY marker.
2005 (enum cpp_token_fld_kind): New.
2006 (struct cpp_token): Add GTY markers.
2007 (cpp_token_val_index): Prototype.
2008 (CPP_HASHNODE_VALUE_IDX): New.
2009 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
2010 * include/cpp-id-data.h: New file.
2011
2012 2004-06-09 Paolo Bonzini <bonzini@gnu.org>
2013
2014 * Makefile.am (all-local): New.
2015 * Makefile.in: Regenerate.
2016
2017 2004-06-06 Roger Sayle <roger@eyesopen.com>
2018
2019 * Makefile.am (LIBICONV): Declare.
2020 (makedepend_LDADD): Use LIBICONV.
2021 * Makefile.in: Regenerate.
2022
2023 2004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
2024
2025 * Makefile.am (LIBINTL): Declare
2026 (makedepend_LDADD): Use LIBINTL.
2027 * Makefile.in: Regenerate.
2028
2029 2004-06-05 Zack Weinberg <zack@codesourcery.com>
2030
2031 * Makefile.am: Add makedepend.
2032 * Makefile.in, aclocal.m4: Regenerate.
2033 * charset.c: Insert a space to avoid a warning.
2034 * directives.c: Include mkdeps.h.
2035 (_cpp_handle_directive): Reenable macro expander if appropriate.
2036 (undefine_macros): Inline body of _cpp_free_definition for speed.
2037 Do not call undef callback or _cpp_warn_if_unused_macro.
2038 (cpp_get_deps): New interface.
2039 * files.c (search_cache): Add pfile argument. Check for file
2040 that would be found by "" or <> search here...
2041 (_cpp_find_file): ...not here. Correct recorded start_dir of
2042 files found by directory-of-current-file search that would be
2043 found by "" or <> search.
2044 * init.c (cpp_add_dependency_target): Delete.
2045 * internal.h (struct lexer_state): Add discarding_output flag.
2046 * lex.c (lex_identifier): Compute hash function while scanning.
2047 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
2048 directives.
2049 * makedepend.c: New file.
2050 * mkdeps.c (struct deps): Add vpath vector.
2051 (apply_vpath, deps_add_vpath): New function.
2052 (deps_free): Free vpath vector.
2053 (deps_add_dep, deps_add_target): Use apply_vpath.
2054 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
2055 (ht_lookup_with_hash): New function.
2056 * cpplib.h, mkdeps.h: Update prototypes.
2057 * symtab.h: Update prototypes.
2058 (HT_HASHSTEP, HT_FINISH): New macros.
2059
2060 2004-05-29 Geoffrey Keating <geoffk@apple.com>
2061
2062 * symtab.c (ht_create): Set entries_owned.
2063 (ht_destroy): Honour entries_owned.
2064 (ht_expand): Likewise.
2065 (ht_load): New.
2066 * include/symtab.h (struct ht): New field 'entries_owned'
2067 (ht_load): New prototype.
2068
2069 2004-05-26 Paolo Bonzini <bonzini@gnu.org>
2070
2071 PR bootstrap/15651
2072 * configure.ac: Fix m4 quoting when picking
2073 the size of HOST_WIDE_INT.
2074 * configure: Regenerate.
2075
2076 2004-05-25 Paolo Bonzini <bonzini@gnu.org>
2077
2078 * Makefile.am: the correct directory for
2079 gettext include files is given by @INCINTL@.
2080 * Makefile.in: Regenerate.
2081
2082 2004-05-24 Paolo Bonzini <bonzini@gnu.org>
2083
2084 * system.h [!ENABLE_NLS]: dgettext takes two
2085 parameters.
2086
2087 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
2088
2089 Moved libcpp from the gcc subdirectory to the toplevel.
2090 * Makefile.am: New file.
2091 * Makefile.in: Regenerate.
2092 * configure.ac: New file.
2093 * configure: Regenerate.
2094 * config.in: Regenerate.
2095 * charset.c: Moved from gcc/cppcharset.c. Add note about
2096 brokenness of input charset detection. Adjust for change
2097 in name of cppucnid.h.
2098 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
2099 * expr.c: Moved from gcc/cppexp.c.
2100 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
2101 Remove #define of O_BINARY, it is in system.h.
2102 * identifiers.c: Moved from gcc/cpphash.c.
2103 * internal.h: Moved from gcc/cpphash.h. Change header
2104 guard name. All other files adjusted to match name change.
2105 * init.c: Moved from gcc/cppinit.c.
2106 (init_library) [ENABLE_NLS]: Call bindtextdomain.
2107 * lex.c: Moved from gcc/cpplex.c.
2108 * directives.c: Moved from gcc/cpplib.c.
2109 * macro.c: Moved from gcc/cppmacro.c.
2110 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
2111 * traditional.c: Moved from gcc/cpptrad.c.
2112 * ucnid.h: Moved from gcc/cppucnid.h. Change header
2113 guard name.
2114 * ucnid.pl: Moved from gcc/cppucnid.pl.
2115 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
2116 guard name.
2117 * symtab.c: Moved from gcc/hashtable.c.
2118 * line-map.c: Moved from gcc. Do not include intl.h.
2119 * mkdeps.c: Moved from gcc.
2120 * system.h: New file.
2121 * include/cpplib.h: Moved from gcc. Change header guard name.
2122 * include/line-map.h: Moved from gcc. Change header guard name.
2123 * include/mkdeps.h: Moved from gcc. Change header guard name.
2124 * include/symtab.h: Moved from gcc/hashtable.h. Change header
2125 guard name.