]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
Emit macro expansion related diagnostics
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
92582b75
TT
12011-10-15 Tom Tromey <tromey@redhat.com>
2 Dodji Seketeli <dodji@redhat.com>
3
4 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
5 New option.
6 * internal.h (struct macro_context): New struct.
7 (enum context_tokens_kind): New enum.
8 (struct cpp_context)<tokens_kind>: New member of type enum
9 context_tokens_kind.
10 (struct cpp_context)<macro>: Remove this. Replace it with an enum
11 of macro and macro_context.
12 (struct cpp_context)<direct_p>: Remove.
13 (_cpp_remaining_tokens_num_in_context): Declare new function.
14 * directives.c (destringize_and_run): Adjust.
15 * lex.c (_cpp_remaining_tokens_num_in_context)
16 (_cpp_token_from_context_at): Define new functions
17 (cpp_peek_token): Use them.
18 * init.c (cpp_create_reader): Initialize the base context to zero.
19 (_cpp_token_from_context_at): Define new static function.
20 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
21 _cpp_token_from_context_at.
22 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
23 members.
24 (enum macro_arg_token_kind): New enum.
25 (struct macro_arg_token_iter): New struct.
26 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
27 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
28 (delete_macro_args, set_arg_token, get_arg_token_location)
29 (arg_token_ptr_at, macro_arg_token_iter_init)
30 (macro_arg_token_iter_get_token)
31 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
32 (expanded_token_index, tokens_buff_new, tokens_buff_count)
33 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
34 (tokens_buff_add_token, tokens_buff_remove_last_token)
35 (reached_end_of_context, consume_next_token_from_context): New
36 static functions.
37 (cpp_get_token_1): New static function. Split and extended from
38 cpp_get_token. Use reached_end_of_context and
39 consume_next_token_from_context. Unify its return point. Move
40 the location tweaking from cpp_get_token_with_location in here.
41 (cpp_get_token): Use cpp_get_token_1
42 (stringify_arg): Use the new arg_token_at.
43 (paste_all_tokens): Support tokens coming from extended tokens
44 contexts.
45 (collect_args): Return the number of collected arguments, by
46 parameter. Store virtual locations of tokens that constitute the
47 collected args.
48 (funlike_invocation_p): Return the number of collected arguments,
49 by parameter.
50 (enter_macro_context): Add a parameter for macro expansion point.
51 Pass it to replace_args and to the "used" cpp callback. Get the
52 number of function-like macro arguments from funlike_invocation_p,
53 pass it to the new delete_macro_args to free the memory used by
54 macro args. When -ftrack-macro-expansion is in effect, for macros
55 that have no arguments, create a macro map for the macro expansion
56 and use it to allocate proper virtual locations for tokens
57 resulting from the expansion. Push an extended tokens context
58 containing the tokens resulting from macro expansion and their
59 virtual locations.
60 (replace_args): Rename the different variables named 'count' into
61 variables with more meaningful names. Create a macro map;
62 allocate virtual locations of tokens resulting from this
63 expansion. Use macro_arg_token_iter to iterate over tokens of a
64 given macro. Handle the case of the argument of
65 -ftrack-macro-expansion being < 2. Don't free macro arguments
66 memory resulting from expand_arg here, as these are freed by the
67 caller of replace_arg using delete_macro_args now. Push extended
68 token context.
69 (next_context, push_ptoken_context, _cpp_push_token_context)
70 (_cpp_push_text_context): Properly initialize the context.
71 (expand_arg): Use the new alloc_expanded_arg_mem,
72 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
73 (_cpp_pop_context): Really free the memory held by the context.
74 Handle freeing memory used by extended tokens contexts.
75 (cpp_get_token_with_location): Use cpp_get_token_1.
76 (cpp_sys_macro_p): Adjust.
77 (_cpp_backup_tokens): Support the new kinds of token contexts.
78 * traditional.c (recursive_macro): Adjust.
79
46427374
TT
802011-10-15 Tom Tromey <tromey@redhat>
81 Dodji Seketeli <dodji@redhat.com>
82
83 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
84 member.
85 (MAX_SOURCE_LOCATION): New constant.
86 (struct line_map_ordinary, struct line_map_macro): New structs.
87 (struct line_map): Turn this into a union of the two above. Add
88 comments.
89 (struct maps_info): New struct.
90 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
91 These now carry the map information that was previously scattered
92 in struct line_maps.
93 (struct map_info::allocated): Fix comment.
94 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
95 (ORDINARY_MAP_STARTING_LINE_NUMBER)
96 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
97 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
98 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
99 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
100 (MACRO_MAP_EXPANSION_POINT_LOCATION)
101 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
102 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
103 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
104 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
105 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
106 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
107 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
108 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
109 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
110 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
111 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
112 information.
113 (linemap_check_ordinary, linemap_assert)
114 (linemap_location_before_p): New macros.
115 (linemap_position_for_line_and_column)
116 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
117 (linemap_macro_expansion_map_p)
118 (linemap_macro_map_loc_to_def_point)
119 (linemap_macro_map_loc_unwind_once)
120 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
121 (linemap_get_source_line linemap_get_source_column)
122 (linemap_map_get_macro_name, linemap_get_file_path)
123 (linemap_location_in_system_header_p)
124 (linemap_location_from_macro_expansion_p): Declare new functions.
125 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
126 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
127 accessors act on ordinary maps only.
128 (INCLUDED_FROM): Return NULL for main files; use the new
129 accessors.
130 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
131 (struct expanded_location): Move here from gcc/input.h
132 (linemap_resolve_location, linemap_expand_location)
133 (linemap_expand_location_full): Declare new functions.
134 * line-map.c: Include cpplib.h, internal.h
135 (linemap_enter_macro, linemap_add_macro_token)
136 (linemap_get_expansion_line, linemap_get_expansion_filename): New
137 functions that are private to libcpp.
138 (linemap_assert): New macro.
139 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
140 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
141 (linemap_macro_map_loc_unwind_toward_spelling)
142 (linemap_macro_map_loc_to_exp_point)
143 (first_map_in_common_1, first_map_in_common): New static
144 functions.
145 (new_linemap): Define new static functions. Extracted and
146 enhanced from ...
147 (linemap_add): ... here. Use linemap_assert in lieu of abort
148 previously.
149 (linemap_tracks_macro_expansion_locs_p)
150 (linemap_add_macro_token, linemap_macro_expansion_map_p)
151 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
152 (linemap_macro_map_loc_to_def_point)
153 (linemap_macro_map_loc_unwind_once)
154 (linemap_step_out_once, linemap_map_get_index)
155 (linemap_get_source_line,linemap_get_source_column)
156 (linemap_get_file_path, linemap_map_get_macro_name)
157 (linemap_location_in_system_header_p)
158 (linemap_location_originated_from_system_header_p)
159 (linemap_location_from_macro_expansion_p)
160 (linemap_tracks_macro_expansion_locs_p)
161 (linemap_resolve_location, linemap_expand_location)
162 (linemap_expand_location_full)
163 (linemap_tracks_macro_expansion_locs_p)
164 (linemap_position_for_line_and_column, linemap_compare_locations):
165 Define new public functions.
166 (linemap_init): Initialize ordinary and macro maps information in
167 the map set.
168 (linemap_check_files_exited): Use the new accessors.
169 (linemap_free): Remove this dead code.
170 (linemap_line_start): Assert this uses an ordinary map. Adjust to
171 use the new ordinary map accessors and data structures. Don't
172 overflow past the lowest possible macro token's location.
173 (linemap_position_for_column): Assert the ordinary maps of the map
174 set are really ordinary. Use ordinary map accessors.
175 (linemap_lookup): Keep the same logic but generalize to allow
176 lookup of both ordinary and macro maps. Do not crash when called
177 with an empty line table.
178 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
179 new API of line-map.h.
180 * directives.c (start_directive, do_line, do_linemarker)
181 (do_linemarker): Likewise.
182 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
183 (make_cpp_dir, cpp_make_system_header): Likewise.
184 * init.c (cpp_read_main_file): Likewise.
185 * internal.h (CPP_INCREMENT_LINE): Likewise.
186 (linemap_enter_macro, linemap_add_macro_token)
187 (linemap_get_expansion_line, linemap_get_expansion_filename): New
188 functions private to libcpp.
189 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
190 (skip_line_comment, skip_whitespace, lex_raw_string)
191 (_cpp_lex_direct): Likewise.
192 * macro.c (_cpp_builtin_macro_text): Likewise.
193 (_cpp_aligned_alloc): Initialize the new name member of the macro.
194 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
195 Likewise.
196 * errors.c (cpp_diagnostic): Adjust to new linemap API.
197
892a371f
DS
1982011-08-28 Dodji Seketeli <dodji@redhat.com>
199
200 * line-map.c (linemap_add): Assert that reason must not be
201 LC_RENAME when called for the first time on a "main input file".
202
e3dfef44
GC
2032011-08-22 Gabriel Charette <gchare@google.com>
204
205 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
206 * internal.h (struct cpp_reader): Add field forced_token_location_p.
207 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
208 (cpp_force_token_locations): New.
209 (cpp_stop_forcing_token_locations): New.
210
32fe396e
RO
2112011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
212
213 PR libstdc++/1773
214 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
215
7c1ffff9
JM
2162011-08-18 Joseph Myers <joseph@codesourcery.com>
217
218 * include/cpplib.h (struct cpp_options): Fix typo.
219
a48e3dd1
JM
2202011-08-18 Joseph Myers <joseph@codesourcery.com>
221
222 * include/cpplib.h (struct cpp_options): Add rliterals.
223 * init.c (struct lang_flags, lang_defaults): Add rliterals.
224 (cpp_set_lang): Set rliterals option.
225 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
226 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
227
3f6ced10
GC
2282011-08-15 Gabriel Charette <gchare@google.com>
229
230 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
231 Update all users to use linemap_position_for_column instead.
232
0681d04c
GC
2332011-07-28 Gabriel Charette <gchare@google.com>
234
235 * include/line-map.h (struct line_maps):
236 Remove unused field last_listed. Update all users.
237
5e9627ca
L
2382011-07-28 H.J. Lu <hongjiu.lu@intel.com>
239
240 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
241 * configure: Regenerated.
242
a024b70f
RO
2432011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
244
245 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
246
5b6d595b
RO
2472011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
248 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
249
250 PR bootstrap/49794
251 * configure.ac: Test AM_ICONV with CXX.
252 * configure: Regenerate.
253 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
254
d0a9fbe1
DS
2552011-07-15 Dodji Seketeli <dodji@redhat.com>
256
257 * directives.c (struct if_stack): Use source_location as type
258 here.
259 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
260 indent, def_pragma, used_define, used_undef>: Properly use
261 source_location as parameter type, rather than unsigned int.
262
fbdd5d87
RO
2632011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
264
265 PR target/39150
266 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
267 like i[34567]86-*-solaris2.1[0-9]*.
268 * configure: Regenerate.
269
8787a05a
JM
2702011-06-16 Jason Merrill <jason@redhat.com>
271
272 PR c++/45399
273 * lex.c (lex_raw_string): Don't check for embedded NUL.
274
38fbfaf6
DS
2752011-06-06 Dodji Seketeli <dodji@redhat.com>
276
277 PR preprocessor/48532
278 * directives.c (do_pragma): Don't forget the invocation location
279 when parsing the pragma name of a namespaced pragma directive.
280
fc0993ac
JT
2812011-05-29 John Tytgat <John.Tytgat@aaug.net>
282
283 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
284
ef230b38
UB
2852011-05-22 Uros Bizjak <ubizjak@gmail.com>
286
287 PR target/49104
288 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
289 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
290
e5b0dad8
JK
2912011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
292
293 * system.h (ENUM_BITFIELD): Remove.
294
6cfae070
JJ
2952011-04-24 Jakub Jelinek <jakub@redhat.com>
296
297 PR preprocessor/48740
298 * lex.c (lex_raw_string): When raw string ends with
299 ??) followed by raw prefix and ", ensure it is preprocessed
300 with ??) rather than ??].
301
04695783
JM
3022011-04-20 Jim Meyering <meyering@redhat.com>
303
304 * files.c (destroy_cpp_file): Remove useless if-before-free.
305 * init.c (cpp_destroy): Likewise.
306 * macro.c (replace_args): Likewise.
307 * pch.c (cpp_valid_state): Likewise.
308
4489800d
KT
3092011-03-25 Kai Tietz <ktietz@redhat.com>
310
311 * files.c (file_hash_eq): Use filename_cmp
312 instead of strcmp.
313 (nonexistent_file_hash_eq): Likewise.
314 (remap_filename): Likewise.
315 Handle absolute DOS-path,
316 (append_file_to_dir): Check for IS_DIR_SEPARATOR
317 instead of slash.
318 (read_name_map): Likewise.
319 * linemap.c (linemap_add): Use filename_cmp
320 instead of strcmp.
321 * mkdeps.c (apply_vpath): Use filename_ncmp
322 instead of strncmp.
323 (deps_restore): Use filename_cmp instead of
324 strcmp.
325 * init.c (read_original_directory): Use
326 IS_DIR_SEPARATOR instead of checking for slash.
327
f3c33d9d
MM
3282011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
329
330 PR preprocessor/48192
331 * directives.c (do_ifdef): Do not consider conditional macros as
332 being defined.
333 (do_ifndef): Ditto.
334 * expr.c (parse_defined): Ditto.
335
01956319
RH
3362011-03-18 Richard Henderson <rth@redhat.com>
337
338 PR bootstrap/45381
339 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
340
c5a62c6f
EB
3412011-11-04 Eric Botcazou <ebotcazou@adacore.com>
342 Jakub Jelinek <jakub@redhat.com>
343
344 PR preprocessor/39213
345 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
346 pragmas as well in traditional mode.
347
0e1a989c
ILT
3482010-11-17 Ian Lance Taylor <iant@google.com>
349
350 PR bootstrap/45538
351 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
352 AC_LANG based on ENABLE_BUILD_WITH_CXX.
353
651a20b5
KT
3542010-11-16 Kai Tietz <kai.tietz@onevision.com>
355
356 PR preprocessor/17349
357 * lex.c (save_comment): Handle in argument passing c++
358 comments special.
359
480767a9
ILT
3602010-11-02 Ian Lance Taylor <iant@google.com>
361
362 * configure.ac: Use AC_SYS_LARGEFILE.
363 * configure: Rebuild.
364 * config.in: Rebuild.
365
078419c9 3662010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 367
078419c9
BS
368 * line-map.h (source_location): Remove obsolete comment
369 mentioning location_s.
370
d6874138
KT
3712010-09-29 Kai Tietz <kai.tietz@onevision.com>
372
373 PR preprocessor/45362
374 * directives.c (cpp_pop_definition): Make static.
375 (do_pragma_push_macro): Reworked to store text
376 definition.
377 (do_pragma_pop_macro): Add free text definition.
378 (cpp_push_definition): Removed.
379 * include/cpplib.h (cpp_push_definition): Removed.
380 (cpp_pop_definition): Likewise.
381 * internal.h (def_pragma_macro): Remove member 'value'
382 and add new members 'definition', 'line',
383 'syshdr', 'sued' and 'is_undef'.
384 * pch.c (_cpp_restore_pushed_macros): Rework to work
385 on text definition and store additional macro flags.
386 (_cpp_save_pushed_macros): Likewise.
387
e3339d0f
JM
3882010-09-29 Joseph Myers <joseph@codesourcery.com>
389
390 * include/cpplib.h (cpp_options): Rename warn_deprecated,
391 warn_traditional, warn_long_long and pedantic.
392 * directives.c (directive_diagnostics, _cpp_handle_directive):
393 Update names of cpp_options members.
394 * expr.c (cpp_classify_number, eval_token): Update names of
395 cpp_options members.
396 * init.c (cpp_create_reader, post_options): Update names of
397 cpp_options members.
398 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
399 cpp_options members.
400 * macro.c (parse_params): Update names of cpp_options members.
401
128465e6
ILT
4022010-09-15 Ian Lance Taylor <iant@google.com>
403
404 * init.c: Fix type name in comment.
405
a69d2520
JJ
4062010-08-31 Jakub Jelinek <jakub@redhat.com>
407
408 PR preprocessor/45457
409 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
410 needed.
411 * directives.c (do_ifdef, do_ifndef): Likewise.
412
707bcb7a
RO
4132010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
414
415 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
416
6f173e52
RH
4172010-08-24 Richard Henderson <rth@redhat.com>
418
419 PR bootstrap/45376
420 * configure.ac (HAVE_SSE4): New check.
421 * configure, config.in: Rebuild.
422 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
423
789d73cb
RO
4242010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
425
426 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
427 etc. on Solaris 2/x86.
428
246a2fcb
RH
4292010-08-21 Richard Henderson <rth@redhat.com>
430 Andi Kleen <ak@linux.intel.com>
431 David S. Miller <davem@davemloft.net>
432
433 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
434 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
435 (ptrdiff_t): Check via AC_CHECK_TYPE.
436 * config.in, configure: Rebuild.
437 * system.h: Include stdint.h, if available.
438 * lex.c (WORDS_BIGENDIAN): Provide default.
439 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
440 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
441 search_line_sse2, search_line_sse42, init_vectorized_lexer,
442 search_line_fast): New.
443 (_cpp_clean_line): Use search_line_fast. Restructure the fast
444 loop to make it clear when we're leaving the loop. Stay in the
445 fast loop for non-trigraph '?'.
446
8e680db5
JJ
4472010-06-11 Jakub Jelinek <jakub@redhat.com>
448
449 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
450 callback.
451 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
452 (cpp_macro_definition): Remove const qual from second argument.
453 * macro.c (enter_macro_context): Call user_builtin_macro callback for
454 NODE_BUILTIN !NODE_USED macros.
455 (warn_of_redefinition): Likewise. Remove const qual from second
456 argument.
457 (cpp_macro_definition): Likewise.
458 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
459 for NODE_BUILTIN !NODE_USED macros.
460
1cb42611
JM
4612010-06-10 Joseph Myers <joseph@codesourcery.com>
462
463 * include/cpplib.h (struct cpp_options): Remove show_column.
464 * init.c (cpp_create_reader, post_options): Don't set show_column.
465
ff5dfc48
JR
4662010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
467
468 PR bootstrap/44432
469 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
470 check that C++ compiler works.
471 * configure: Regenerate.
472
a9429e29
LB
4732010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
474
475 * include/symtab.h (ht_identifier_ptr): New.
476
c3f247f4
RW
4772010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
478 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
479
480 PR bootstrap/42798
481 * configure.ac: Check for declaration of 'basename(char *)'.
482 * configure: Regenerate.
483 * config.in: Regenerate.
484
2778d766
JM
4852010-04-25 Joseph Myers <joseph@codesourcery.com>
486
487 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
488 * init.c (lang_defaults): Add entries for new language variants.
489 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
490 variants.
491
d8a12e84
MLI
4922010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
493
494 PR cpp/43195
495 * files.c (report_missing_guard): Test for #pragma once.
496
87cf0651
SB
4972010-04-07 Simon Baldwin <simonb@google.com>
498
499 * directives.c (do_diagnostic): Add warning reason argument,
500 call appropriate error reporting function for code.
501 (directive_diagnostics): Call specific warning functions with
502 warning reason where appropriate.
503 (do_error, do_warning, do_pragma_dependency): Add warning reason
504 argument to do_diagnostic calls.
505 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
506 _cpp_create_definition): Call specific warning functions with
507 warning reason where appropriate.
508 * Makefile.in: Add new diagnostic functions to gettext translations.
509 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
510 to error callback.
511 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
512 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
513 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
514 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
515 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
516 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
517 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
518 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
519 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
520 warning reason codes.
521 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
522 cpp_warning_with_line, cpp_pedwarning_with_line,
523 cpp_warning_with_line_syshdr): New specific error reporting functions.
524 * pch.c (cpp_valid_state): Call specific warning functions with
525 warning reason where appropriate.
526 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
527 diagnostic handlers.
528 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
529 cpp_warning_with_line, cpp_pedwarning_with_line,
530 cpp_warning_with_line_syshdr): New specific error reporting functions.
531 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
532 specific warning functions with warning reason where appropriate.
533 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
534 warn_about_normalization, lex_identifier_intern, lex_identifier,
535 _cpp_lex_direct): Ditto.
536 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
537 narrow_str_to_charconst): Ditto.
538
d947ada0
JJ
5392010-04-06 Jakub Jelinek <jakub@redhat.com>
540
541 PR preprocessor/43642
542 * lex.c (lex_raw_string): Change type of TYPE variable to
543 unsigned char.
544
4d9e8446
RW
5452010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
546
547 * aclocal.m4: Regenerate.
548
52150625
JM
5492010-03-29 Jason Merrill <jason@redhat.com>
550
00a81b8b
JM
551 More N3077 raw string changes
552 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
553 strings.
554 * lex.c (bufring_append): Split out from...
555 (lex_raw_string): ...here. Undo trigraph and line splicing
556 transformations. Do process line notes in multi-line literals.
557 (_cpp_process_line_notes): Ignore notes that were already handled.
558
52150625
JM
559 Some raw string changes from N3077
560 * charset.c (cpp_interpret_string): Change inner delimiters to ().
561 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
562
709d7160
JJ
5632010-02-11 Jakub Jelinek <jakub@redhat.com>
564
565 * init.c (read_original_filename): Don't call read_original_directory
566 if _cpp_handle_directive returns 0.
567
dadab4fd
JM
5682010-01-01 Joseph Myers <joseph@codesourcery.com>
569
570 PR preprocessor/41947
571 * expr.c (cpp_classify_number): Give error for hexadecimal
572 floating-point constant with no digits before or after point.
573
3de8a540
AC
5742009-11-20 Arnaud Charlet <charlet@adacore.com>
575
576 * macro.c (enter_macro_context): Call cb.used callback if defined.
577 * directives.c (do_idef, do_ifndef): Ditto.
578 * include/cpplib.h (struct cpp_callbacks): Add used callback.
579
17e7cb85
KT
5802009-11-11 Kai Tietz <kai.tietz@onevision.com>
581
582 * directives.c (do_pragma_push_macro): New pragma handler.
583 (do_pragma_pop_macro): Likewise.
584 (_cpp_init_internal_pragmas): Add push_macro and
585 pop_macro handler to internal pragmas.
586 (lex_macro_node_from_str): Removed.
587 (cpp_push_definition): Replace lex_macro_node_from_str
588 by _cpp_lex_identifier.
589 (cpp_pop_definition): Likewise.
590 * internal.h (_cpp_lex_identifier): New prototype.
591 (def_pragma_macro): New structure.
592 (cpp_reader): New member pushed_macros.
593 * lex.c (_cpp_lex_identifier): New function.
594 (lex_identifier_intern): New function.
595 * init.c (cpp_create_reader): Initialize pushed_macros
596 member.
597 (cpp_destroy): Free elements in pushed_macros member.
598 * pch.c (_cpp_save_pushed_macros): New function.
599 (_cpp_restore_pushed_macros): Likewise.
600 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
601 (cpp_read_state): Use _cpp_restore_pushed_macros.
602
2c6e3f55
JJ
6032009-10-19 Jakub Jelinek <jakub@redhat.com>
604
605 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
606 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
607 and char32_cset_desc.
608 (converter_for_type): Handle CPP_UTF8STRING.
609 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
610 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
611 (parse_include): Reject raw strings.
612 * include/cpplib.h (CPP_UTF8STRING): New token type.
613 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
614 * lex.c (lex_raw_string): New function.
615 (lex_string): Handle u8 string literals, call lex_raw_string
616 for raw string literals.
617 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
618 sequences.
619 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
620
96c169e1
JJ
6212009-10-14 Jakub Jelinek <jakub@redhat.com>
622
623 PR preprocessor/41543
624 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
625 * line-map.c (linemap_init): Initialize highest_location and
626 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
627
30c99a9e
JM
6282009-10-09 Jason Merrill <jason@redhat.com>
629
630 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
631
2214382c
NV
6322009-10-09 Neil Vachharajani <nvachhar@google.com>
633
634 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
635 sccs.
636
e02222d2
LR
6372009-09-23 Loren J. Rittle <ljrittle@acm.org>
638
639 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
640 * configure: Rebuilt.
641
9a8a2b7a
RG
6422009-09-22 Richard Guenther <rguenther@suse.de>
643
644 PR pch/38987
645 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
646
74dc6a11
CD
6472009-09-18 Chris Demetriou <cgd@google.com>
648
649 PR preprocessor/28435:
650 * include/cpplib.h (struct cpp_options): Add new member
651 deps.need_preprocessor_output.
652 * files.c (open_file_failed): If preprocessor output is needed
653 always report an error.
654
933608b7
KT
6552009-09-13 Kai Tietz <kai.tietz@onevision.com>
656
657 * configure.ac: Set for i?86-w64-mingw*
658 need_64bit_hwint to yes.
659 * configure: Regenerated.
660
86373e7e
JM
6612009-09-10 Jason Merrill <jason@redhat.com>
662
663 * directives.c (cpp_define): constify.
664
fd2ab214
ILT
6652009-09-02 Ian Lance Taylor <iant@google.com>
666
667 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
668
df58e648
RW
6692009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
670
671 * configure.ac (AC_PREREQ): Bump to 2.64.
672
5213506e
RW
6732009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
674
675 * aclocal.m4: Regenerate.
676 * config.in: Regenerate.
677 * configure: Regenerate.
678
709a22df
TT
6792009-08-17 Tom Tromey <tromey@redhat.com>
680
681 PR preprocessor/41067:
682 * charset.c (convert_escape): Add missing ":" to error text.
683
0c539b47
DR
6842009-07-27 Douglas B Rupp <rupp@gnat.com>
685
686 * include/cpplib.h (INO_T_CPP): New macro.
687 (struct cpp_dir): Use it.
688
2b69c841
JQ
6892009-07-20 Jerry Quinn <jlquinn@optonline.net>
690
691 PR regression/40800
692 * configure.ac: Use = instead of == for testing
693 ENABLE_BUILD_WITH_CXX.
694 * configure: Rebuild.
695
f1bf410c
JQ
6962009-07-17 Jerry Quinn <jlquinn@optonline.net>
697
698 * directives.c (do_linemarker, do_line): Use CPP_STRING for
699 ignored enum value.
700 * files.c (find_file_in_dir): Add cast from void* to char*.
701 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
702 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
703 warnings.
704 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
705 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
706 COMPILER_FLAGS): New.
707 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
708 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
709 instead of ALL_CFLAGS.
710 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
711 from other warnings. Add -Wc++-compat to C-specific warnings.
712 Check for --enable-build-with-cxx. Set and substitute
713 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
714 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
715 AC_CHECK_HEADERS.
716 * configure: Rebuild.
717 * include/cpp-id-data.h: Remove extern "C".
718 * include/line-map.h: Likewise.
719 * include/mkdeps.h: Likewise.
720 * include/symtab.h: Likewise.
721 * internal.h: Likewise.
722
a28fbdba
MLI
7232009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
724
725 * directives.c (parse_include): Add location argument. Update all
726 calls.
727 (parse_answer): Likewise.
728 (do_include_common): Error with exact location.
729 (parse_assertion): Likewise.
730
b506a5a2
MLI
7312009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
732
733 * expr.c (num_div_op): Take explicit location.
734
7d8847a4
ILT
7352009-06-17 Ian Lance Taylor <iant@google.com>
736
737 * include/cpplib.h (progname): Don't declare.
738
3d8b2a98
ILT
7392009-06-12 Ian Lance Taylor <iant@google.com>
740
741 * include/cpplib.h (struct cpp_options): Add
742 warn_cxx_operator_names field.
743 (NODE_WARN_OPERATOR): Define.
744 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
745 type to 6 bits.
746 * init.c (mark_named_operators): Add flags parameter.
747 (cpp_post_options): Pick flags value to pass to
748 mark_named_operators.
749 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
750 identifier is an operator name in C++.
751
e74fe492
AH
7522009-06-01 Aldy Hernandez <aldyh@redhat.com>
753
754 * include/line-map.h (LAST_SOURCE_COLUMN): New.
755
4851089f
ILT
7562009-06-01 Ian Lance Taylor <iant@google.com>
757
758 * include/cpp-id-data.h: Add extern "C".
759 * include/line-map.h: Likewise.
760 * include/mkdeps.h: Likewise.
761 * include/symtab.h: Likewise.
762 * internal.h: Likewise.
763
7e5487a2
ILT
7642009-05-15 Ian Lance Taylor <iant@google.com>
765
766 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
767 builtin_type. Change all uses.
768
00b0c19b
MLI
7692009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
770
771 PR cpp/36674
772 * directives (do_linemarker): Compensate for the increment in
773 location that occurs when we reach the end of line.
774 * files (_cpp_stack_include): Mention _cpp_find_file in the
775 comment.
776
9a0c6187
JM
7772009-05-10 Joseph Myers <joseph@codesourcery.com>
778
779 * include/cpplib.h (enum cpp_token_fld_kind): Add
780 CPP_TOKEN_FLD_TOKEN_NO.
781 (struct cpp_macro_arg, struct cpp_identifier): Define.
782 (union cpp_token_u): Use struct cpp_identifier for identifiers.
783 Use struct cpp_macro_arg for macro arguments. Add token_no for
784 CPP_PASTE token numbers.
785 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
786 do_pragma_poison, parse_assertion): Use val.node.node in place of
787 val.node.
788 * expr.c (parse_defined, eval_token): Use val.node.node in place
789 of val.node.
790 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
791 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
792 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
793 place of val.arg_no. Use val.node.node in place of val.node.
794 * macro.c (replace_args, cpp_get_token, parse_params,
795 lex_expansion_token, create_iso_definition, cpp_macro_definition):
796 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
797 Use val.node.node in place of val.node.
798
9e322bc1
JM
7992009-05-03 Joseph Myers <joseph@codesourcery.com>
800
801 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
802 UTF-8 sequences.
803
f88d0772
JM
8042009-04-25 Joseph Myers <joseph@codesourcery.com>
805
806 PR preprocessor/39559
807 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
808 constants larger than intmax_t in C99 mode.
809
d1b38208
TG
8102009-04-21 Taras Glek <tglek@mozilla.com>
811
812 * include/cpp-id-data.h: Update GTY annotations to new syntax.
813 * include/cpplib.h: Likewise.
814 * include/line-map.h: Likewise.
815 * include/symtab.h: Likewise.
816
cfc93532
MLI
8172009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
818
819 PR c++/14875
820 * lex.c (cpp_type2name): Take a flags parameter. Call
821 cpp_named_operator2name for named operators and cpp_digraph2name
822 for digraphs.
823 (cpp_digraph2name): New.
824 (cpp_spell_token): Use it.
825 (cpp_output_token): Likewise.
826 * include/cpplib.h (cpp_type2name): Update declaration.
827 * init.c (cpp_named_operator2name): New.
828 * internal.h (cpp_named_operator2name): Declare.
829
9c650d90
MLI
8302009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
831
832 PR c++/13358
833 * init.c (cpp_create_reader): Wlong_long is disabled by default.
834 * expr.c (cpp_classify_number): Give different messages for C and
835 C++ front-ends.
836
aa508502
JM
8372009-04-19 Joseph Myers <joseph@codesourcery.com>
838
839 PR preprocessor/20078
840 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
841 field.
842 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
843 (struct cpp_token): Change flags to unsigned short.
844 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
845 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
846 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
847 tokens.
848 * macro.c (macro_real_token_count): New.
849 (enter_macro_context, replace_args): Use macro_real_token_count.
850 (create_iso_definition): Record whitespace surrounding and digraph
851 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
852 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
853 multiple consecutive ## tokens.
854 (_cpp_create_definition): Initialize extra_tokens.
855 (cpp_macro_definition): Use macro_real_token_count.
856
61cc8223
JM
8572009-04-18 Joseph Myers <joseph@codesourcery.com>
858
859 * directives.c (parse_include): Pass true to check_eol.
860
c7f9c0b9
JM
8612009-04-18 Joseph Myers <joseph@codesourcery.com>
862
863 PR preprocessor/39646
864 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
865 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
866 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
867 place of LC_RENAME.
868
a5cb563b
JM
8692009-04-18 Joseph Myers <joseph@codesourcery.com>
870
871 PR preprocessor/39647
872 * directives.c (check_eol): Add parameter expand.
873 (do_undef, parse_include, do_line, do_linemarker, do_ident,
874 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
875 do_else, do_endif, do_assert, do_unassert): All callers changed.
876 Pass true from do_line, false elsewhere.
877
18f41a1b
JM
8782009-04-12 Joseph Myers <joseph@codesourcery.com>
879
880 PR preprocessor/31869
881 * macro.c (stringify_arg): Handle NULL source token in padding
882 token where previous padding token did not have source token with
883 preceding whitespace.
884
748086b7
JJ
8852009-04-09 Jakub Jelinek <jakub@redhat.com>
886
887 * Makefile.in: Change copyright header to refer to version
888 3 of the GNU General Public License and to point readers at the
889 COPYING3 file and the FSF's license web page.
890 * charset.c: Likewise.
891 * directives-only.c: Likewise.
892 * directives.c: Likewise.
893 * errors.c: Likewise.
894 * expr.c: Likewise.
895 * files.c: Likewise.
896 * identifiers.c: Likewise.
897 * include/cpp-id-data.h: Likewise.
898 * include/cpplib.h: Likewise.
899 * include/line-map.h: Likewise.
900 * include/mkdeps.h: Likewise.
901 * include/symtab.h: Likewise.
902 * init.c: Likewise.
903 * internal.h: Likewise.
904 * lex.c: Likewise.
905 * line-map.c: Likewise.
906 * macro.c: Likewise.
907 * makeucnid.c: Likewise.
908 * mkdeps.c: Likewise.
909 * pch.c: Likewise.
910 * symtab.c: Likewise.
911 * system.h: Likewise.
912 * traditional.c: Likewise.
913 * ucnid.tab: Likewise.
914 * ucnid.h: Regenerate.
915
eec49116
JJ
9162009-04-01 Janis Johnson <janis187@us.ibm.com>
917
839a3b8a
JJ
918 PR c/39027
919 * include/cpplib.h (CPP_N_DEFAULT): Define.
920 * expr.c (interpret_float_suffix): Recognize d or D for double,
921 return new value for default.
922 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
923
eec49116
JJ
924 PR c/33466
925 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
926 letters from decimal float and fixed-point suffixes.
927
47580d22
JM
9282009-03-31 Joseph Myers <joseph@codesourcery.com>
929
930 PR preprocessor/15638
931 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
932 invalid PCH.
933 (open_file_failed): Make error for missing file fatal.
934 * include/cpplib.h (CPP_DL_FATAL): Define.
935
5a2df0fa
SV
9362009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
937
938 PR preprocessor/31932:
939 * internal.h: Don't mention HAVE_ICONV_H.
940 * configure, config.in: Rebuild.
941 * configure.ac: Don't check for iconv.h.
942
c1a8a3c6
TT
9432009-03-30 Tom Tromey <tromey@redhat.com>
944
945 PR preprocessor/39512:
946 * line-map.c (linemap_init): Initialize 'reallocator' field.
947
a37a7b8a
JJ
9482009-03-30 Jakub Jelinek <jakub@redhat.com>
949
950 PR target/39558
951 * macro.c (cpp_get_token): If macro_to_expand returns NULL
952 and used some tokens, add CPP_PADDING before next token.
953
148e4216
JM
9542009-03-29 Joseph Myers <joseph@codesourcery.com>
955
956 PR preprocessor/34695
957 * makedepend.c: Remove.
958 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
959 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
960 * directives.c (cpp_errors): Remove.
961 * errors.c (print_location, _cpp_begin_message, v_message):
962 Remove.
963 (cpp_error, cpp_error_with_line): Always use error callback.
964 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
965 * include/cpplib.h (cpp_options): Remove pedantic_errors,
966 inhibit_warnings, warn_system_headers, inhibit_errors,
967 warnings_are_errors, client_diagnostic.
968 (cpp_callbacks): Add extra arguments to error callback; make it
969 return bool.
970 (cpp_finish): Return void.
971 (cpp_destroy): Remove inaccurate comment about return value.
972 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
973 (CPP_DL_NOTE): Define.
974 * include/line-map.h (linemap_print_containing_files): Remove.
975 * init.c (cpp_finish): Do not check for or return number of
976 errors.
977 * internal.h (cpp_reader): Remove errors field.
978 * line-map.c (linemap_print_containing_files): Remove.
979 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
980 about previous definition. Only emit it if previous diagnostic
981 was emitted.
982
f1450211
JM
9832009-03-28 Joseph Myers <joseph@codesourcery.com>
984
985 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
986 mkinstalldirs.
987
8f5929e1
JJ
9882009-03-18 Jakub Jelinek <jakub@redhat.com>
989
990 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
991
4bb09c26
JM
9922009-02-21 Joseph Myers <joseph@codesourcery.com>
993
994 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
995 header name.
996 (_cpp_lex_direct): Handle this.
997
68c9ab45
RG
9982009-02-15 Richard Guenther <rguenther@suse.de>
999
1000 Revert last change.
1001
601b3e1a
RG
10022009-02-13 Richard Guenther <rguenther@suse.de>
1003
1004 * configure.ac: Enable LFS.
1005 * configure: Re-generate.
1006 * config.in: Likewise.
1007
fc0cd180
BE
10082009-01-05 Ben Elliston <bje@au.ibm.com>
1009
1010 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
1011 (.po.pox): Likewise.
1012 (po/$(PACKAGE).pot): Likewise.
1013
db89a3be
AO
10142008-12-10 Alexandre Oliva <aoliva@redhat.com>
1015
1016 PR target/37033
1017 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
1018 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
1019
cc955282
JM
10202008-11-29 Joseph Myers <joseph@codesourcery.com>
1021
1022 * lex.c (cpp_token_len): Use 6 as default length.
1023
47960aaf
MLI
10242008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
1025
1026 * expr.c (struct op): Add location.
1027 (_cpp_parse_expr): Propagate locations throught the stack
1028 of expressions.
1029 (reduce): Likewise.
1030 (check_promotion): Use explicit location in errors.
1031
631d0d36
MG
10322008-10-05 Matthew Gingell <gingell@adacore.com>
1033 Arnaud Charlet <charlet@adacore.com>
1034
1035 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
1036 (cpp_get_comments): New function.
1037 * internal.h (struct cpp_reader): Add comments field.
1038 * init.c (cpp_destroy): Free comments.
1039 * lex.c (store_comment, cpp_get_comments): New functions.
1040 (comments): New struct.
1041 (save_comment): Store comments in comments struct.
1042
c047ce93
SB
10432008-09-18 Simon Baldwin <simonb@google.com>
1044
1045 * include/cpplib.h (struct cpp_options): Add new boolean flag
1046 warn_builtin_macro_redefined.
1047 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
1048 * (struct builtin_operator): Split out from previous struct builtin,
1049 enhance extra const correctness.
1050 * (struct builtin_macro): Split out from previous struct builtin, add
1051 new always_warn_if_redefined flag, enhance const correctness.
1052 * (mark_named_operators): Use struct builtin_operator.
1053 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
1054 to builtins selectively.
1055 * macro.c (warn_of_redefinition): Return false if a builtin macro
1056 is not flagged with NODE_WARN.
1057
affa55c6
JJ
10582008-07-31 Jakub Jelinek <jakub@redhat.com>
1059
1060 PR preprocessor/36649
1061 * files.c (struct report_missing_guard_data): New type.
1062 (report_missing_guard): Put paths into an array instead of printing
1063 them right away. Return 1 rather than 0.
1064 (report_missing_guard_cmp): New function.
1065 (_cpp_report_missing_guards): Sort and print paths gathered by
1066 report_missing_guard callback.
1067
3b8f20a1
MLI
10682008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1069
1070 PR 28079
1071 * directives.c (strtolinenum): Handle overflow.
1072 (do_line): Give a warning if line number overflowed.
1073 (do_linemarker): Update call to strtolinenum.
1074
1bb64668
MLI
10752008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1076
1077 * include/line-map.h (linenum_type): New typedef.
1078 (struct line_map): Use it.
1079 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
1080 (SOURCE_COLUMN): Likewise.
1081 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
1082 source_location values in a variable of type linenum_type.
1083 * directives.c (struct if_stack): Use linenum_type.
1084 (strtoul_for_line): Rename as strtolinenum.
1085 (do_line): Use linenum_type.
1086 (do_linemarker): Use linenum_type and strtolinenum.
1087 (_cpp_do_file_change): Use linenum_t.
1088 * line-map.c (linemap_add): Likewise.
1089 (linemap_line_start): Likewise.
1090 * traditional.c (struct fun_macro): 'line' is a source_location.
1091 * errors.c (print_location): Use linenum_type.
1092 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
1093 * internal.h (CPP_INCREMENT_LINE): Likewise.
1094 * lex.c (_cpp_skip_block_comment): Use source_location.
1095
5950c3c9
BE
10962008-07-14 Ben Elliston <bje@au.ibm.com>
1097
1098 * include/cpplib.h (NODE_CONDITIONAL): New.
1099 (struct cpp_callbacks): New macro_to_expand field.
1100 (struct cpp_hashnode): Adjust size of flags and type fields.
1101 (cpp_peek_token): Prototype.
1102 * lex.c (cpp_peek_token): New function.
1103 (_cpp_temp_token): Protect pre-existing lookaheads.
1104 * macro.c (cpp_get_token): Expand any conditional macros.
1105 (_cpp_backup_tokens_direct): New.
1106 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
1107 (warn_of_redefinition): Silently allow redefined conditional
1108 macros.
1109 (_cpp_create_definition): Remove the conditional flag when a user
1110 defines one of the conditional macros.
1111 * internal.h (_cpp_backup_tokens_direct): New prototype.
1112
e85edc9e
AH
11132008-06-13 Andrew Haley <aph@redhat.com>
1114
1115 PR preprocessor/33305
1116 * macro.c (replace_args): Print a warning for empty macro
1117 arguments in C89 and C++.
1118
18c04407
RW
11192008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1120
1121 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
1122 * configure: Regenerate.
1123
2d09b640
RW
11242008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1125
1126 * Makefile.in (datarootdir): New variable.
1127
0b7c73cc
L
11282008-06-12 H.J. Lu <hongjiu.lu@intel.com>
1129
1130 PR preprocessor/36479
1131 * charset.c (cpp_interpret_string_notranslate): Also set
1132 narrow_cset_desc.width.
1133
cd985f66
JM
11342008-06-07 Joseph Myers <joseph@codesourcery.com>
1135
1136 * configure.ac (parisc*64*-*-*): Remove.
1137 * configure: Regenerate.
1138
d750887f
TT
11392008-05-30 Tom Tromey <tromey@redhat.com>
1140
1141 PR preprocessor/36320:
1142 * internal.h (_cpp_parse_expr): Update.
1143 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
1144 messages.
1145 * directives.c (do_if): Update.
1146 (do_elif): Require expression if processing group.
1147
c100de59
DS
11482008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
1149
1150 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
1151
5d6342eb
TT
11522008-05-21 Tom Tromey <tromey@redhat.com>
1153
1154 PR preprocessor/27777:
1155 * lex.c (cpp_output_line_to_string): New function.
1156 * internal.h (_cpp_begin_message): Don't declare.
1157 * errors.c (_cpp_begin_message): Now static.
1158 * include/cpplib.h (cpp_output_line_to_string): Declare.
1159 * directives.c (do_diagnostic): Rewrote. Use
1160 cpp_output_line_to_string. Don't use _cpp_begin_message.
1161
dae4174e
TT
11622008-05-21 Tom Tromey <tromey@redhat.com>
1163
1164 * include/symtab.h (HT_ALLOCED): Remove.
1165 (ht_purge): Declare.
1166 * symtab.c (DELETED): New define.
1167 (ht_lookup): Update comment.
1168 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
1169 code. Use subobject allocator for strings, if it exists.
1170 (ht_expand): Handle deleted entries.
1171 (ht_forall): Likewise.
1172 (ht_purge): New function.
1173 (ht_dump_statistics): Print deletion statistics.
1174
899015a0
TT
11752008-05-13 Tom Tromey <tromey@redhat.com>
1176
1177 PR preprocessor/22168:
1178 * include/cpplib.h (struct cpp_options) <objc>: Update
1179 documentation.
1180 * expr.c (eval_token): Warn for use of assertions.
1181 * directives.c (directive_diagnostics): Warn about extensions.
1182 (DEPRECATED): New define.
1183 (DIRECTIVE_TABLE): Use it.
1184
71c10038
TT
11852008-05-06 Tom Tromey <tromey@redhat.com>
1186
1187 PR preprocessor/35313, PR preprocessor/36088:
1188 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
1189 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
1190
2bd0fe3d
DM
11912008-05-04 David S. Miller <davem@davemloft.net>
1192
1193 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
1194 * configure: Regenerate.
1195
28f68625
DF
11962008-04-22 Daniel Franke <franke.daniel@gmail.com>
1197
1198 * include/cpplib.h (cpp_define_formatted): New.
1199 * directives.c (cpp_define_formatted): New.
1200
688e7a53
TT
12012008-04-21 Tom Tromey <tromey@redhat.com>
1202
1203 PR libcpp/33415:
1204 * charset.c (_cpp_convert_input): Add buffer_start argument.
1205 Ignore UTF-8 BOM if seen.
1206 * internal.h (_cpp_convert_input): Add argument.
1207 * files.c (struct _cpp_file) <buffer_start>: New field.
1208 (destroy_cpp_file): Free buffer_start, not buffer.
1209 (_cpp_pop_file_buffer): Likewise.
1210 (read_file_guts): Update.
1211
b6baa67d
KVH
12122008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1213
1214 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
1215 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
1216 (struct cpp_options): Added uliterals.
1217 (cpp_interpret_string): Update prototype.
1218 (cpp_interpret_string_notranslate): Idem.
1219 * charset.c (init_iconv_desc): New width member in cset_converter.
1220 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
1221 (convert_ucn): Idem.
1222 (emit_numeric_escape): Idem.
1223 (convert_hex): Idem.
1224 (convert_oct): Idem.
1225 (convert_escape): Idem.
1226 (converter_for_type): New function.
1227 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
1228 (cpp_interpret_string_notranslate): Match changed prototype.
1229 (wide_str_to_charconst): Use converter_for_type.
1230 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
1231 * directives.c (linemarker_dir): Macro U changed to UC.
1232 (parse_include): Idem.
1233 (register_pragma_1): Idem.
1234 (restore_registered_pragmas): Idem.
1235 (get__Pragma_string): Support CPP_STRING{16,32}.
1236 * expr.c (eval_token): Support CPP_CHAR{16,32}.
1237 * init.c (struct lang_flags): Added uliterals.
1238 (lang_defaults): Idem.
1239 * internal.h (struct cset_converter) <width>: New field.
1240 (struct cpp_reader) <char16_cset_desc>: Idem.
1241 (struct cpp_reader) <char32_cset_desc>: Idem.
1242 * lex.c (digraph_spellings): Macro U changed to UC.
1243 (OP, TK): Idem.
1244 (lex_string): Add support for u'...', U'...', u"..." and U"...".
1245 (_cpp_lex_direct): Idem.
1246 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
1247 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
1248
deb984e6
PB
12492008-04-18 Paolo Bonzini <bonzini@gnu.org>
1250
1251 PR bootstrap/35457
1252 * aclocal.m4: Regenerate.
1253 * configure: Regenerate.
1254
bf048bea
TT
12552008-04-17 Tom Tromey <tromey@redhat.com>
1256
1257 PR libcpp/34866:
1258 * errors.c (cpp_error): Don't reference a token before the start
1259 of the current run.
1260
7f27b0f8
TT
12612008-04-16 Tom Tromey <tromey@redhat.com>
1262
1263 * Makefile.in (TAGS_SOURCES): New variable.
1264 (TAGS): New target.
1265
a1fcb9a1
KK
12662008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
1267
1268 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
1269 and shbe-*-*.
1270 * configure: Rebuilt.
1271
93d45d9e
JM
12722008-04-02 Joseph Myers <joseph@codesourcery.com>
1273
1274 * include/cpplib.h (struct cpp_callbacks): Add used_define,
1275 used_undef and before_define.
1276 (NODE_USED): Define.
1277 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
1278 do_ifndef, cpp_pop_definition): Handle new flag and use new
1279 callbacks.
1280 * expr.c (parse_defined): Handle new flag and use new callbacks.
1281 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
1282 flag and use new callbacks.
1283
d4c32e1d
JJ
12842008-04-01 Jakub Jelinek <jakub@redhat.com>
1285
1286 PR pch/13675
1287 * files.c (struct _cpp_file): Remove pch field.
1288 (pch_open_file): Don't set file->pch, just file->pchname.
1289 (should_stack_file): After pfile->cb.read_pch call
1290 free pchname and clear pchname, don't close file->fd.
1291 Test file->pchname instead of file->pch. Don't close fd after cb.
1292 (_cpp_stack_include): Test file->pchname instead of file->pch.
1293
161031e3
TT
12942008-03-28 Tom Tromey <tromey@redhat.com>
1295
1296 * Makefile.in (POSTCOMPILE): New variable.
1297 (.c.o): Use it.
1298
14ccf800
TT
12992008-03-13 Tom Tromey <tromey@redhat.com>
1300
1301 PR libcpp/35322:
1302 * directives.c (destringize_and_run): Set pfile->directive.
1303
830465c6
MM
13042008-03-06 Markus Milleder <markus.milleder@generali.at>
1305
1306 PR preprocessor/35458
1307 * mkdeps.c (munge): Quote '#' with a '\'.
1308
d482a073
RW
13092008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1310
1311 PR preprocessor/35379
1312 * mkdeps.c (deps_write): Ensure the first target always appears
1313 in the first column, without leading backslash newline. Avoid
1314 some more extra whitespace.
1315
185a6cc1
TS
13162008-02-25 Thiemo Seufer <ths@mips.com>
1317
d482a073 1318 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 1319
2bf41bf0
TT
13202008-02-19 Tom Tromey <tromey@redhat.com>
1321
1322 * traditional.c (lex_identifier): Use CPP_HASHNODE.
1323 * lex.c (lex_identifier): Use CPP_HASHNODE.
1324 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
1325 do-while.
1326 * identifiers.c (alloc_node): Change return type.
1327 (_cpp_init_hashtable): Don't cast 'alloc_node'.
1328 (proxy_assertion_broken): New declaration.
1329 (cpp_forall_identifiers): Move comment.
1330 * line-map.c (linemap_add): Comment fix.
1331 (linemap_line_start): Indentation fix.
1332
765d600a
JJ
13332008-01-25 Jakub Jelinek <jakub@redhat.com>
1334
1335 PR preprocessor/34692
1336 * macro.c (collect_args): Add pragma_buff argument. Push
1337 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
1338 than into arguments. Reset prevent_expansion and parsing_args
1339 state at CPP_PRAGMA_EOL/CPP_EOF.
1340 (funlike_invocation_p): Add pragma_buff argument, pass it through
1341 to collect_args.
1342 (enter_macro_context): Add result argument. Adjust
1343 funlike_invocation_p caller. Emit all deferred pragma tokens
1344 gathered during collect_args before the expansion, add a padding
1345 token. Return 2 instead of 1 if any pragma tokens were prepended.
1346 (cpp_get_token): If enter_macro_context returns 2, don't return
1347 a padding token, instead cycle to grab CPP_PRAGMA token.
1348 * directives.c (_cpp_handle_directive): If was_parsing_args
1349 in deferred pragma, leave parsing_args and prevent_expansion as is.
1350
ec46053b
TT
13512008-01-22 Tom Tromey <tromey@redhat.com>
1352
765d600a 1353 PR c++/34859
ec46053b
TT
1354 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
1355 __STDC_CONSTANT_MACROS.
1356
681c6ab0
FF
13572008-01-07 Fred Fish <fnf@specifix.com>
1358
765d600a 1359 PR preprocessor/30363
681c6ab0
FF
1360 * traditional.c (replace_args_and_push): Add local variable
1361 cxtquote, calculate the replacement text size assuming a
1362 worst case of every input character quoted with backslash,
1363 and properly handle output quoting of quote characters in
1364 actual arguments used in function-like macros.
1365
33ae4837
TT
13662008-01-03 Tom Tromey <tromey@redhat.com>
1367
765d600a 1368 PR preprocessor/34602
33ae4837
TT
1369 * directives.c (do_line): Don't try to spell EOF token.
1370 (do_linemarker): Add comment.
1371
675575f5
DD
13722007-12-11 DJ Delorie <dj@redhat.com>
1373
1374 * charset.c (convert_using_iconv): Close out any shift states,
1375 returning to the initial state.
1376
97f6bd40
TT
13772007-12-06 Tom Tromey <tromey@redhat.com>
1378
765d600a 1379 PR c/29172
97f6bd40
TT
1380 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
1381 type.
1382 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
1383 * files.c (FILE_HASH_POOL_SIZE): New macro.
1384 (struct file_hash_entry_pool): New.
1385 (destroy_all_cpp_files): New function.
1386 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
1387 (new_file_hash_entry): Update.
1388 (free_file_hash_entries): New function.
1389 (_cpp_cleanup_files): Call free_file_hash_entries and
1390 destroy_all_cpp_files.
1391 (cpp_clear_file_cache): New function.
1392 * include/cpplib.h (cpp_clear_file_cache): Declare.
1393
d56a25e1
TT
13942007-12-03 Tom Tromey <tromey@redhat.com>
1395
765d600a 1396 PR preprocessor/34288
d56a25e1
TT
1397 * configure.ac, config.in: Rebuilt.
1398 * configure.ac: Check for ssize_t.
1399
607f74e9
TT
14002007-11-30 Tom Tromey <tromey@redhat.com>
1401
765d600a 1402 PR preprocessor/32868
607f74e9
TT
1403 * macro.c (_cpp_create_definition): Special case
1404 __STDC_FORMAT_MACROS.
1405
b0f4807f
MM
14062007-11-16 Michael Matz <matz@suse.de>
1407
1408 * files.c (search_path_head): Fix check for absolute paths.
1409
f1e20710
TT
14102007-11-11 Tom Tromey <tromey@redhat.com>
1411
765d600a 1412 PR c++/17557
f1e20710
TT
1413 * include/cpplib.h (cpp_included_before): Declare.
1414 * files.c (struct file_hash_entry) <location>: New field.
1415 (_cpp_find_file): Initialize new field.
1416 (make_cpp_dir): Likewise.
1417 (cpp_included_before): New function.
1418
f373b44d
TT
14192007-11-01 Tom Tromey <tromey@redhat.com>
1420
765d600a 1421 PR preprocessor/30805
f373b44d
TT
1422 * macro.c (paste_tokens): Handle padding token.
1423 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
1424
5b9a40df
TT
14252007-10-31 Tom Tromey <tromey@redhat.com>
1426
765d600a 1427 PR preprocessor/30786
5b9a40df
TT
1428 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
1429 * directives.c (_cpp_do__Pragma): Return error status.
1430 * internal.h (_cpp_do__Pragma): Update.
1431 * directives.c (get__Pragma_string): Back up if EOF seen.
1432
5ffeb913
TT
14332007-09-06 Tom Tromey <tromey@redhat.com>
1434
1435 * internal.h (struct cpp_reader) <invocation_location>: New
1436 field.
1437 (struct cpp_reader) <set_invocation_location>: Likewise.
1438 * init.c (cpp_set_line_map): New function.
1439 * line-map.c (linemap_add): Use linemap's allocator.
1440 * include/line-map.h (GTY): Define.
1441 (line_map_realloc): New typedef.
1442 (struct line_map): Mark with GTY.
1443 (struct line_maps): Likewise.
1444 (struct line_maps) <maps>: Likewise.
1445 (struct line_maps) <reallocator>: New field.
1446 * include/symtab.h (GTY): Conditionally define.
1447 * include/cpplib.h (cpp_set_line_map): Declare.
1448 (cpp_get_token_with_location): Declare.
1449 * macro.c (cpp_get_token): Set invocation_location on the reader.
1450 (cpp_get_token_with_location): New function.
1451
ac6b1c67
CF
14522007-08-30 Chao-ying Fu <fu@mips.com>
1453
1454 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
1455 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
1456 (cpp_classify_number): Support decimal fixed-point constants without
1457 exponents.
1458 Warn about fixed-point constants when -pedantic.
1459 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
1460 comments to support fixed-point values.
1461 (CPP_N_FRACT, CPP_N_ACCUM): Define.
1462
cda5e672
TT
14632007-08-18 Tom Tromey <tromey@redhat.com>
1464
765d600a 1465 PR preprocessor/32974
cda5e672
TT
1466 * directives.c (parse_include): Don't check for EOL when
1467 processing #pragma dependency.
1468
ccfc4c91
OW
14692007-07-30 Ollie Wild <aaw@google.com>
1470
1471 * directives-only.c: New file.
1472 * internal.h (struct _cpp_dir_only_callbacks): New.
1473 (_cpp_preprocess_dir_only): New function.
1474 * directives.c (_cpp_handle_directive): Check directives_only before
1475 disabling execution of indented directives.
1476 * files.c (_cpp_stack_file): Add directives_only check.
1477 * include/cpplib.h (struct cpp_options): Add directives_only.
1478 (cpp_init_special_builtins): New function.
1479 * init.c (cpp_init_special_builtins): New function.
1480 (cpp_init_builtins): Move builtin_array initialization to
1481 cpp_init_special_builtins.
1482 (post_options): Check directives_only before setting
1483 pfile->state.prevent_expansion = 1.
1484 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
1485 is expanded inside a directive while -fdirectives-only is enabled.
1486 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
1487 (libcpp_a_SOURCES): Add directives-only.c.
1488
a206413a
UB
14892007-07-04 Uros Bizjak <ubizjak@gmail.com>
1490
1491 * traditional.c (_cpp_scan_out_logical_line): Initialize
1492 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
1493 fmacro.args to prevent 'may be used uninitialized' warning.
1494
c77cd3d1
UB
14952007-07-03 Uros Bizjak <ubizjak@gmail.com>
1496
1497 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
1498 Add new constants.
1499 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
1500 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
1501 for 'q' or 'Q' suffixes.
1502
66938a1d
DS
15032007-06-17 Danny Smith <dannysmith@users.sourceforge.net
1504
e1311401 1505 * files.c (open_file): Correct typo.
66938a1d 1506
71995ede
VP
15072007-06-16 Vladimir Prus <vladimir@codesourcery.com>
1508
e1311401 1509 * files.c (open_file): Prevent the call
71995ede
VP
1510 for stat from overwriting errno.
1511
84152c25
VP
15122007-06-09 Vladimir Prus <vladimir@codesourcery.com>
1513
e1311401 1514 * files.c (open_file): Account for the
84152c25
VP
1515 fact that on windows, opening a directory gives
1516 EACCES.
1517
f7fd775f
JW
15182007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
1519
1520 PR preprocessor/23479
1521 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
1522 integer constants.
1523 (append_digit): Likewise.
1524 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
1525 binary integer constants.
1526
ed0e74e0
DK
15272007-05-31 Dave Korn <dave.korn@artimi.com>
1528
1529 PR preprocessor/14331
1530 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
1531
a702045a
OW
15322007-05-24 Ollie Wild <aaw@google.com>
1533
1534 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
1535 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
1536 (cpp_write_pch_state): Save __COUNTER__ state.
1537 (cpp_valid_state): Check valid __COUNTER__ state.
1538 (cpp_read_state): Read new __COUNTER__ state.
1539 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
1540 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
1541 * internal.h (struct cpp_reader): Add counter member.
1542
126e073b
SM
15432007-05-23 Simon Martin <simartin@users.sourceforge.net>
1544
1545 PR preprocessor/20077
1546 * macro.c (create_iso_definition): Fixed the method to determine
1547 whether the token-pasting operator appears at the beginning or the end
1548 of a macro.
1549
0b4cafec
ILT
15502007-05-21 Ian Lance Taylor <iant@google.com>
1551
1552 * internal.h (struct cpp_reader): Add new fields:
1553 nonexistent_file_hash and nonexistent_file_ob.
1554 * files.c: Include "obstack.h".
1555 (find_file_in_dir): Before trying to open the file, look up the
1556 path name in the hash table of nonexistent files. After failing
1557 to open the file, add the path name to the hash table.
1558 (_cpp_find_file): Cache the results of looking up the file name
1559 starting with the quote and bracket chain heads, if we can.
1560 (nonexistent_file_hash_eq): New static function.
1561 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
1562 pfile->nonexistent_file_ob.
1563 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
1564 pfile->nonexistent_file_ob.
1565
30e04921
JJ
15662007-05-14 Janis Johnson <janis187@us.ibm.com>
1567
5a6bb57e
JJ
1568 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
1569
30e04921
JJ
1570 PR c/31924
1571 * expr.c (interpret_float_suffix): Check for invalid suffix.
1572
22a8a52d
EC
15732007-05-02 Eric Christopher <echristo@apple.com>
1574
1575 * expr.c (num_div_op): Don't overflow if the result is
1576 zero.
1577
fca35e1b
TT
15782007-05-02 Tom Tromey <tromey@redhat.com>
1579
765d600a 1580 PR preprocessor/28709
fca35e1b
TT
1581 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
1582
4cd97075
MM
15832007-03-30 Michael Meissner <michael.meissner@amd.com>
1584
1585 * directives.c (lex_macro_node_from_str): Fix alloca call to be
1586 type correct.
1587
121de39f
RH
15882007-03-30 Richard Henderson <rth@redhat.com>
1589
1590 * directives.c (lex_macro_node_from_str): New.
1591 (cpp_push_definition, cpp_pop_definition): New.
1592 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
1593
4fcb360b
BM
15942007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1595
1596 * Makefile.in: Add dummy install-pdf target.
1597
67e64439
TT
15982007-01-30 Tom Tromey <tromey@redhat.com>
1599
765d600a 1600 PR preprocessor/30468
67e64439
TT
1601 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
1602 './'.
1603
ee380365
TT
16042007-01-30 Tom Tromey <tromey@redhat.com>
1605
765d600a 1606 PR preprocessor/29966
ee380365
TT
1607 * macro.c (lex_expansion_token): Save and restore cpp_reader's
1608 cur_token.
1609 (_cpp_create_definition): Don't restore cur_token here.
1610 * lex.c (_cpp_lex_token): Added assertion.
1611
024abeb3
TT
16122007-01-27 Tom Tromey <tromey@redhat.com>
1613
1614 * configure: Rebuilt.
1615
ee1c2a10
TT
16162007-01-12 Tom Tromey <tromey@redhat.com>
1617
765d600a 1618 PR preprocessor/28227
ee1c2a10
TT
1619 * directives.c (lex_macro_node): Added 'is_def_or_undef'
1620 argument.
1621 (do_define): Update.
1622 (do_undef): Update.
1623 (do_ifdef): Update.
1624 (do_ifndef): Update.
1625
67214c16
PB
16262007-01-11 Paolo Bonzini <bonzini@gnu.org>
1627
1628 * configure: Regenerate.
1629
1aa6ca40
PB
16302007-01-11 Paolo Bonzini <bonzini@gnu.org>
1631
1632 * configure: Regenerate.
1633
705e2d28
TT
16342007-01-04 Tom Tromey <tromey@redhat.com>
1635
765d600a 1636 PR preprocessor/28165
705e2d28
TT
1637 * internal.h (cpp_in_primary_file): New function.
1638 * directives.c (do_include_next): Use cpp_in_primary_file.
1639 (do_pragma_once): Likewise.
1640 (do_pragma_system_header): Likewise.
1641
7af45bd4
ILT
16422006-12-29 Ian Lance Taylor <iant@google.com>
1643
1644 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
1645 look backward at the end of the line unless we saw a backslash.
1646
9d30f270
JJ
16472006-12-29 Jakub Jelinek <jakub@redhat.com>
1648
1649 PR preprocessor/29612
1650 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
1651 only when new_sysp is non-zero.
1652
30b0edc0
TT
16532006-12-28 Tom Tromey <tromey@redhat.com>
1654
765d600a 1655 PR preprocessor/30001
30b0edc0
TT
1656 * charset.c (_cpp_convert_input): Check that to.len is greater
1657 than zero.
1658
85d9c13c
TS
16592006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
1660
1661 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 1662 * configure: Rebuilt.
85d9c13c 1663
dfafdaa6
DG
16642006-11-01 Douglas Gregor <doug.gregor@gmail.com>
1665
1666 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
1667 for experimental C++0x mode.
1668 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
1669 adopted the preprocessor changes introduced in C99.
1670
0f45f0f5
JM
16712006-10-29 Joseph Myers <joseph@codesourcery.com>
1672
1673 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
1674 depending on --enable-targets=all.
1675 * configure: Regenerate.
1676
de000d22
JJ
16772006-10-12 Jakub Jelinek <jakub@redhat.com>
1678
1679 PR preprocessor/28709
1680 * macro.c (paste_tokens): Do error reporting here, use BUF with the
1681 spelled LHS token as opposed to spelling it again.
1682 (paste_all_tokens): Don't report errors here, just break on failure.
1683
b5422ad7
BM
16842006-10-10 Brooks Moses <bmoses@stanford.edu>
1685
1686 * Makefile.in: Added empty "pdf" target.
1687
aaf50ff2
GK
16882006-09-22 Geoffrey Keating <geoffk@apple.com>
1689
1690 * configure.ac: Make need_64_bit_hwint case for x86-darwin
1691 match exactly the glob in gcc/config.gcc.
1692 * configure: Regenerate.
1693
c663e301
JM
16942006-09-13 Joseph S. Myers <joseph@codesourcery.com>
1695
1696 PR c/28768
1697 PR preprocessor/14634
1698 * lex.c (lex_string): Pedwarn for unterminated literals.
1699
f7288899
EC
17002006-09-08 Eric Christopher <echristo@apple.com>
1701
1702 * configure.ac: Add 64-bit HWI support for i?86-darwin.
1703
b52dbbf8
SE
17042006-08-14 Steve Ellcey <sje@cup.hp.com>
1705
1706 PR c++/28288
1707 PR c++/14556
1708 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
1709 (CPP_LAST_EQ): Change.
1710 (CPP_LAST_PUNCTUATOR): Change.
1711 * expr.c (cpp_operator): Remove MIN and MAX.
1712 (reduce): Remove CPP_MIN and CPP_MAX.
1713 (num_binary_op): Ditto.
1714 * lex.c (_cpp_lex_direct): Ditto.
1715 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
1716
1c90c6f9
JJ
17172006-06-09 Jakub Jelinek <jakub@redhat.com>
1718
1719 PR preprocessor/27746
1720 * directives.c (do_pragma): Handle pragma with valid namespace
1721 and invalid name coming from macro expansion.
1722 * directives.c (destringize_and_run): Initialize next field in
1723 context.
1724
1725 PR c/27747
1726 PR c++/27748
1727 * directives.c (destringize_and_run): Set NO_EXPAND on the
1728 tokens.
1729
1730 * macro.c (_cpp_backup_tokens): Fix comment typo.
1731
5c3c3683
DJ
17322006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
1733
1734 * Makefile.in (CATALOGS): Add po/ prefix.
1735 * configure: Regenerated.
1736
b2bd74bc
CD
17372006-05-23 Carlos O'Donell <carlos@codesourcery.com>
1738
1739 * Makefile.in: Add install-html target. Add install-html to .PHONY
1740
be8ac3e2
GZ
17412006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
1742
1743 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
1744 * files.c (_cpp_get_file_stat): New function.
1745 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
1746 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
1747 * internal.h (_cpp_get_file_stat): Prototype.
1748 (struct cpp_buffer): Add timestamp.
1749
83900997
JJ
17502006-01-23 Jakub Jelinek <jakub@redhat.com>
1751
1752 PR preprocessor/25717
1753 * init.c (cpp_init_builtins): If __STDC__ will not change value
1754 between system headers and other sources, define it as a normal
1755 macro rather than a builtin.
1756 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
1757 cpp_in_system_header condition.
1758
17592006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
1760
1761 * Makefile.in: Use -MMD instead of -MD.
1762
bc4071dd
RH
17632006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
1764 Richard Henderson <rth@redhat.com>
1765
1766 Merge from gomp branch:
1767 * directives.c (struct pragma_entry): Add is_deferred. Add ident
1768 entry to value union.
1769 (end_directive): Don't eat the line if in_deferred_pragma.
1770 (run_directive): Remove pragma hacks.
1771 (insert_pragma_entry): Remove.
1772 (new_pragma_entry): New.
1773 (register_pragma_1): Split out of register_pragma. Only handle
1774 the lookup tree and return the new entry.
1775 (cpp_register_pragma): Fill in the pragma entry here.
1776 (cpp_register_deferred_pragma): New.
1777 (register_pragma_internal): New.
1778 (_cpp_init_internal_pragmas): Use register_pragma_internal.
1779 (do_pragma): Allow pragma expansion after namespace. For deferred
1780 pragmas, don't slurp the line into a string.
1781 (destringize_and_run): Save tokens for deferred pragmas.
1782 (cpp_handle_deferred_pragma): Remove.
1783 * macro.c (builtin_macro): Remove pragma token hack.
1784 (_cpp_push_token_context): Rename from push_token_context and export.
1785 * internal.h (struct lexer_state): Add pragma_allow_expansion.
1786 (_cpp_push_token_context): Declare.
1787 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
1788 a token. Update the line number correctly if so.
1789 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
1790 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
1791 * include/cpplib.h (PRAGMA_EOL): New.
1792 (CPP_TOKEN_FLD_PRAGMA): New.
1793 (struct cpp_token): Add val.pragma.
1794 (struct cpp_options): Remove defer_pragmas.
1795 (cpp_handle_deferred_pragma): Remove.
1796 (cpp_register_deferred_pragma): Declare.
1797
d09e893f
JJ
17982006-01-01 Jakub Jelinek <jakub@redhat.com>
1799
1800 PR c++/25294
1801 * directives.c (do_pragma): If pragma line ends with multi-line
1802 block comment, end the saved deferred pragma string before that
1803 comment. Handle embedded '\0' chars on the pragma line.
1804
ab84748a
VR
18052005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
1806
1807 PR c++/23333
1808 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
1809
ad6ed77e
JG
18102005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
1811 Ben Elliston <bje@au.ibm.com>
1812
1813 * include/cpplib.h (CPP_N_DFLOAT): New.
1814 * expr.c (interpret_float_suffix): Identify df, dd, and dl
1815 suffixes as decimal floating point constants.
1816 (cpp_classify_number): Disallow hexadecimal DFP constants.
1817
ba096620 18182005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 1819 Ian Lance Taylor <ian@airs.com>
ba096620
GP
1820
1821 * include/cpplib.h (struct cpp_callbacks): Annotate error with
1822 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
1823
456b8ce5
UB
18242005-11-09 Per Bothner <per@bothner.com>
1825 Uros Bizjak <uros@kss-loka.si>
f7288899 1826
456b8ce5
UB
1827 PR c/24101
1828 * init.c (read_original_filename): Temporarily set
1829 state.in_directive before calling _cpp_lex_direct for
1830 CPP_HASH tokens.
1831
5571f74f
JW
18322005-11-03 James E Wilson <wilson@specifix.com>
1833
1834 PR preprocessor/24202
1835 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
1836
a63607ed
JM
18372005-11-04 Joseph S. Myers <joseph@codesourcery.com>
1838
1839 * include/cpplib.h (struct cpp_callbacks): Make error take
1840 va_list* parameter.
1841 * errors.c (cpp_error): Update call to callback.
1842
651ed942
AP
18432005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
1844
1845 PR preprocessor/22042
1846 * macro.c (_cpp_builtin_macro_text): Lower the needed max
1847 buffer size.
1848 (cpp_quote_string): Don't octalify non printable
1849 charactors.
1850
178b58b5
JM
18512005-11-03 Joseph S. Myers <joseph@codesourcery.com>
1852
1853 PR c++/17964
1854 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
1855 (struct cpp_callbacks): Add error.
1856 * errors.c (cpp_error): If client_diagnostic, use error callback.
1857 * charset.c (convert_escape): Don't use %03o in diagnostic.
1858
3ee5ed11 18592005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
1860
1861 PR preprocessor/15220
1862 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
1863 callers. Pass to open_file_failed.
1864 (open_file_failed): New parameter angle_brackets. Fix all callers.
1865 Use in print_dep assignment.
1866 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
1867 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 1868
077fc835
KH
18692005-10-08 Kazu Hirata <kazu@codesourcery.com>
1870
1871 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
1872 * configure: Regenerate.
1873
cbc43ae0
ILT
18742005-10-04 Ian Lance Taylor <ian@airs.com>
1875
1876 PR preprocessor/13726
1877 * directives.c (check_eol_return_comments): New static function.
1878 (parse_include): Add buf parameter. Change all callers.
1879 (do_include_common): If not discard comments, turn on
1880 save_comments. Pass collected comments to include callback.
1881 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
1882 include callback: cpp_token list.
1883
af15a2fe
JM
18842005-09-20 Joseph S. Myers <joseph@codesourcery.com>
1885
1886 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
1887 * init.c (struct lang_flags, lang_defaults): Add
1888 extended_identifiers.
1889 (cpp_set_lang): Use it.
1890 * lex.c (forms_identifier_p): Check extended_identifiers.
1891
f5eab47e
JJ
18922005-08-30 Jakub Jelinek <jakub@redhat.com>
1893
1894 PR preprocessor/20348
1895 PR preprocessor/20356
1896 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
1897 2004-06-05 changes.
1898
467129e6
KG
18992005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1900
1901 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
1902 -Wmissing-format-attribute.
1903
1904 * configure: Regenerate.
1905
200031d1
KC
19062005-06-29 Kelley Cook <kcook@gcc.gnu.org>
1907
1908 * all files: Update FSF address in copyright headers.
1909 * makeucnid.c (write_copyright): Update outputted FSF address.
1910
f610dd5f
ZW
19112005-06-13 Zack Weinberg <zack@codesourcery.com>
1912
1913 * configure.ac: Invoke ZW_CREATE_DEPDIR and
1914 ZW_PROG_COMPILER_DEPENDENCIES.
1915 * aclocal.m4, configure: Regenerate.
1916 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
1917 New variables.
1918 (distclean): Clean up $(DEPDIR) and its contents.
1919 (.c.o): Use $(COMPILE).
1920 Include $(DEPDIR)/*.Po for most object->header dependencies.
1921
c3f829c1
GDR
19222005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1923
1924 * configure.ac: Check declarations for asprintf and vasprintf.
1925 * config.in: Regenerate.
1926 * configure: Likewise.
1927
1928 * charset.c (conversion_loop): Use XRESIZEVEC.
1929 (convert_no_conversion): Likewise.
1930 (convert_using_iconv): Likewise.
1931 (init_iconv_desc): Cast return value of alloca.
1932 (cpp_host_to_exec_charset): Use XNEWVEC.
1933 (emit_numeric_escape): Use XRESIZEVEC.
1934 (cpp_interpret_string): Use XNEWVEC.
1935 (cpp_interpret_string): Use XRESIZEVEC.
1936 (_cpp_interpret_identifier): Cast return value of alloca.
1937 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
1938 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
1939 (parse_include): Use XNEWVEC.
1940 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 1941 "new_entry".
c3f829c1
GDR
1942 (save_registered_pragmas): Cast return value of xmemdup.
1943 (destringize_and_run): Same for alloca.
1944 (parse_assertion): Likewise.
1945 (do_assert): Cast allocated storage to proper type.
1946 (cpp_define): Likewise.
1947 (_cpp_define_builtin): Likewise.
1948 (cpp_undef): Likewise.
1949 (handle_assertion): Likewise.
1950 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
1951 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
1952 (CPP_UMINUS): Likewise.
1953 (struct cpp_operator): Rename from struct operator.
1954 (_cpp_expand_op_stack): Use XRESIZEVEC.
1955 * files.c (pch_open_file): Use XNEWVEC.
1956 (pch_open_file): Use XRESIZEVEC.
1957 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
1958 (dir_name_of_file): Use XNEWVEC.
1959 (make_cpp_file): Use XCNEW.
1960 (make_cpp_dir): Likewise.
1961 (allocate_file_hash_entries): USE XNEWVEC.
1962 (cpp_included): Cast return value of htab_find_with_hash.
1963 (append_file_to_dir): Use XNEWVEC.
1964 (read_filename_string): Likewise. Use XRESIZEVEC too.
1965 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
1966 (remap_filename): Use XNEWVEC.
1967 (struct pchf_entry): Move definition out of struct pchf_data.
1968 (_cpp_save_file_entries): Use XCNEWVAR.
1969 (_cpp_read_file_entries): Use XNEWVAR.
1970 * identifiers.c (alloc_node): Use XOBNEW.
1971 * init.c (cpp_create_reader): Use XCNEW.
1972 (cpp_init_builtins): Cast of b->value to enum builtin_type.
1973 (read_original_directory): Cast return value of alloca.
1974 * lex.c (add_line_note): Use XRESIZEVEC.
1975 (warn_about_normalization): Use XNEWVEC.
1976 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
1977 (new_buff): Use XNEWVEC.
1978 * line-map.c (linemap_add): Use XRESIZEVEC.
1979 * macro.c (builtin_macro): Cast return value of alloca.
1980 (paste_tokens): Likewise.
1981 (expand_arg): Use XNEWVEC and XRESIZEVEC.
1982 (_cpp_save_parameter): Use XRESIZEVEC.
1983 (create_iso_definition): Cast allocated storage to proper type.
1984 (_cpp_create_definition): Likewise.
1985 (cpp_macro_definition): Use XRESIZEVEC.
1986 * makedepend.c (add_clm): Use XNEW.
1987 (add_dir): Likewise.
1988 * mkdeps.c (munge): Use XNEWVEC.
1989 (deps_init): Use XCNEW.
1990 (deps_add_target): Use XRESIZEVEC.
1991 (deps_add_default_target): Cast return value of alloca.
1992 (deps_add_dep): Use XRESIZEVEC.
1993 (deps_add_vpath): Likewise. Use XNEWVEC too.
1994 (deps_restore): Likewise.
1995 * pch.c (save_idents): Use XNEW and XNEWVEC.
1996 (cpp_save_state): Use XNEW.
1997 (count_defs): Cast return value of htab_find.
1998 (write_defs): Likewise.
1999 (cpp_write_pch_deps): Use XNEWVEC.
2000 (collect_ht_nodes): Use XRESIZEVEC.
2001 (cpp_valid_state): Use XNEWVEC.
2002 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
2003 * symtab.c (ht_create): Use XCNEW.
2004 (ht_lookup_with_hash): Cast return value of obstack_copy0.
2005 (ht_expand): Use XCNEWVEC.
2006 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
2007 (bool): Do not define if __cplusplus.
2008
1ed17cd5
ZW
20092005-05-12 Zack Weinberg <zack@codesourcery.com>
2010
2011 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
2012 (do_sccs): Delete function definition, #define to do_ident.
2013 (do_ident): Don't hardwire directive name.
2014
5a8c20ce
RK
20152005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
2016
2017 PR bootstrap/21230
2018 * configure: Regenerate.
2019
473c5bc9
AP
20202005-04-27 Andris Pavenis <pavenis@latnet.lv>
2021
2022 * files.c: Include io.h for DJGPP to get prototype of setmode.
2023
c1fc5047
PB
20242005-04-19 Per Bothner <per@bothner.com>
2025
2026 PR preprocessor/20907
2027 * line-map.c (linemap_line_start): Fix bug when we need to increse
2028 column_bits but can re-use the current line_map.
2029
042630ad
KG
20302005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2031
2032 * system.h (fopen, fdopen, freopen): Define these to the unlocked
2033 libiberty functions.
2034
0d667716
KG
20352005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2036
2037 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
2038 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
2039 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
2040 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
2041 _unlocked function.
2042 (fwrite_unlocked): Fix prototype.
1ed17cd5 2043
0d667716
KG
2044 * configure, config.in: Regenerate.
2045
cae064e7
JJ
20462005-04-05 Jakub Jelinek <jakub@redhat.com>
2047
2048 PR preprocessor/19475
2049 * macro.c (create_iso_definition): For < ISO C99, don't
2050 pedwarn if there is no whitespace between macro name and its
2051 replacement, but the replacement starts with a basic character
2052 set character.
2053
cbada204
AJ
20542005-03-28 Andreas Jaeger <aj@suse.de>
2055
2056 * lex.c (warn_about_normalization): Cast field width to int to
2057 avoid warning.
2058
f42eccdb
JM
20592005-03-19 Joseph S. Myers <joseph@codesourcery.com>
2060
2061 * configure.ac: Consistently use solaris2.1[0-9]* instead of
2062 solaris2.1[0-9].
2063 * configure: Regenerate.
2064
c79e602b
GK
20652005-03-15 Geoffrey Keating <geoffk@apple.com>
2066
2067 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
2068 UCN rather than printing an error.
2069
50668cf6
GK
20702005-03-14 Geoffrey Keating <geoffk@apple.com>
2071
6baba9bb
GK
2072 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
2073
20742005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 2075
50668cf6
GK
2076 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
2077 * charset.c: Update for new format of ucnid.h.
2078 (ucn_valid_in_identifier): Update for new format of ucnid.h.
2079 Add NST parameter, and update it; update callers.
2080 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
2081 with cpp_error.
2082 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
2083 * internal.h (struct normalize_state): New.
2084 (INITIAL_NORMALIZE_STATE): New.
2085 (NORMALIZE_STATE_RESULT): New.
2086 (NORMALIZE_STATE_UPDATE_IDNUM): New.
2087 (_cpp_valid_ucn): New.
2088 * lex.c (warn_about_normalization): New.
2089 (forms_identifier_p): Add normalize_state parameter, update callers.
2090 (lex_identifier): Add normalize_state parameter, update callers. Keep
2091 the state current.
2092 (lex_number): Likewise.
2093 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
2094 it with warn_about_normalization.
2095 * makeucnid.c: New.
2096 * ucnid.h: Replace.
2097 * ucnid.pl: Remove.
2098 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
2099 comments about obsolete version of C++.
2100 * include/cpplib.h (enum cpp_normalize_level): New.
2101 (struct cpp_options): Add warn_normalize field.
2102
47e20491
GK
21032005-03-11 Geoffrey Keating <geoffk@apple.com>
2104
2105 * directives.c (glue_header_name): Update call to cpp_spell_token.
2106 * internal.h (_cpp_interpret_identifier): New.
2107 * charset.c (_cpp_interpret_identifier): New.
2108 (_cpp_valid_ucn): Allow UCN version of '$'.
2109 * lex.c (lex_identifier): Add extra parameter to indicate if initial
2110 character was '$' or '\'. Support identifiers with UCNs.
2111 (forms_identifier_p): Allow UCNs.
2112 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
2113 (utf8_to_ucn): New.
2114 (cpp_spell_token): Add FORSTRING parameter. Use it.
2115 (cpp_token_as_text): Update call to cpp_spell_token.
2116 (cpp_output_token): Write UCNs back out.
2117 (stringify_arg): Update call to cpp_spell_token.
2118 (paste_tokens): Likewise.
2119 (cpp_macro_definition): Likewise.
2120 * macro.c (stringify_arg): Likewise.
2121 (paste_tokens): Likewise.
2122 (cpp_macro_definition): Likewise.
2123 * include/cpplib.h: Add parameter to cpp_spell_token.
2124
73096711
JJ
21252005-03-04 Jakub Jelinek <jakub@redhat.com>
2126
2127 PR bootstrap/20282
2128 PR bootstrap/20305
2129 * macro.c (replace_args, cpp_get_token): Copy whole
2130 cpp_token_u instead of just cpp_string field from it.
2131
2203a881
DP
21322005-02-28 Devang Patel <dpatel@apple.com>
2133
2134 * directives.c (do_line): Save sysp early before line table is
2135 realloc'ed.
1ed17cd5 2136
c5ff069d
ZW
21372005-02-20 Zack Weinberg <zack@codesourcery.com>
2138
2139 PR 18785
2140 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
2141 (cpp_host_to_exec_charset): New function.
2142 * include/cpplib.h: Declare cpp_host_to_exec_charset.
2143
04c90eea
DP
21442005-02-19 Devang Patel <dpatel@apple.com>
2145
2146 * charset.c (_cpp_convert_input): Check '\r' before inserting
2147 '\n' at the end.
c5ff069d 2148
6da55c00
EC
21492005-02-15 Eric Christopher <echristo@redhat.com>
2150
2151 PR preprocessor/19077
2152 * macro.c (cpp_macro_definition): Move handling of whitespace
2153 to PREV_WHITE conditional. Remove overloading of len
2154 variable.
2155
31c3e631
KH
21562005-02-14 Kazu Hirata <kazu@cs.umass.edu>
2157
2158 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
2159 traditional.c: Update copyright.
2160
be0f1e54
PB
21612005-02-14 Paolo Bonzini <bonzini@gnu.org>
2162
2163 PR bootstrap/19818
2164 * configure.ac: Check for declaration of basename and getopt.
2165 * config.in: Regenerate.
2166 * configure: Regenerate.
2167 * internal.h (ustrcspn): New.
2168 * macro.c (create_iso_definition): Fix allocation of memory.
2169 (padding_token): Add cast to remove const-ness.
2170 * pch.c (cpp_read_state): Use ustrcspn.
2171
ecddfb39
MS
21722005-02-08 Mike Stump <mrs@apple.com>
2173
2174 * files.c (pchf_adder): Remove.
2175 (struct pchf_adder_info): Likewise.
2176 (_cpp_save_file_entries): Write out all files so that #import works.
2177
9fcdd891
JM
21782005-01-23 Joseph S. Myers <joseph@codesourcery.com>
2179
2180 * configure: Regenerate.
2181
ecfd72e7
TS
21822005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
2183
2184 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
2185
6c25a4f7 2186 * include/cpplib.h: Also update copyright years.
c5ff069d 2187
942926ad
GK
21882005-01-03 Geoffrey Keating <geoffk@apple.com>
2189
2190 * files.c (_cpp_find_file): Add files found by search_path_exhausted
2191 to the list of all files.
2192
a2566ae9
GDR
21932005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
2194
2195 * internal.h: Update references to Cpp lib filenames.
2196 * directives.c: Likewise.
2197 * init.c: Likewise.
2198 * macro.c: Likewise.
2199 * traditional.c: Likewise.
2200
1b449375
EB
22012004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
2202
2203 PR preprocessor/15167
2204 * files.c (destroy_cpp_file): New function.
2205 (should_stack_file): Make a new file if the
2206 compared file is still stacked.
2207
28303828
NN
22082004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
2209
c5ff069d 2210 PR preprocessor/17610
28303828
NN
2211 * directives.c (do_include_common): Error out if an empty filename
2212 is given for #include (or #include_next or #import).
2213
c812785a
RS
22142004-11-27 Roger Sayle <roger@eyesopen.com>
2215 Zack Weinberg <zack@codesourcery.com>
2216
2217 * internal.h: Replace all uses of uchar with unsigned char.
2218 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
2219 with !IN_GCC, so uchar is only defined whilst building libcpp.
2220
f91eaa01
KC
22212004-11-24 Kelley Cook <kcook@gcc.gnu.org>
2222
2223 * aclocal.m4: Regenerate.
2224
f78ce0c2
RS
22252004-11-24 Roger Sayle <roger@eyesopen.com>
2226
2227 PR preprocessor/15824
2228 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
2229 directly, instead of the non-existant "system.h" and "ansidecl.h".
2230 * configure: Regenerate.
2231
b5b3e36a 22322004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 2233 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
2234
2235 * internal.h (struct lexer_state): Add in_deferred_pragma.
2236 * directives.c (struct pragma_entry): Add allow_expansion.
2237 (insert_pragma_entry): Take allow_expansion flag.
2238 (register_pragma): Likewise.
2239 (cpp_register_pragma): Likewise.
2240 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
2241 (do_pragma): Honor allow_expansion.
2242 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
2243 * include/cpplib.h (cpp_register_pragma): Update prototype.
2244
a8e68029 22452004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 2246 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
2247
2248 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
2249 need_64bit_hwint=yes.
2250 * configure: Regenerate.
2251
50f47ee0
JM
22522004-11-09 Joseph S. Myers <joseph@codesourcery.com>
2253
2254 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
2255 po/$(PACKAGE).pot.
2256 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
2257 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
2258 Remove local srcdir path from generated file.
2259
968e08d6 22602004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 2261 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
2262
2263 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
2264 as well.
2265
3da3d587
ZW
22662004-10-27 Zack Weinberg <zack@codesourcery.com>
2267
2268 PR 18075
2269 * directives.c (do_pragma): Do not defer pragmas which are unknown.
2270 (cpp_handle_deferred_pragma): Add cast to silence warning.
2271
ac24fc25
JM
22722004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
2273
2274 * errors.c (_cpp_begin_message): Print "error: " for errors.
2275
7731405b
AJ
22762004-10-10 Andreas Jaeger <aj@suse.de>
2277
2278 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
2279 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
2280
646544e3
AP
22812004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
2282
2283 * pch.c (cpp_write_pch_state): Remove variable z as it is not
2284 used.
2285 (cpp_read_state): Remove unused variables, m, d and mac_count.
2286
67a74146
PB
22872004-09-29 Per Bothner <per@bothner.com>
2288
2289 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
2290 cb.line_change. Otherwise do_pragma will call the line_change
2291 call-back with a meaningless line number.
2292
018a4785
ZW
22932004-09-24 Zack Weinberg <zack@codesourcery.com>
2294
2295 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
2296 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
2297 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
2298 * aclocal.m4, configure: Regenerate.
2299 * init.c: Include localedir.h.
2300 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
2301 (DEFS): Delete.
2302 (.c.o): Use $(ALL_CFLAGS).
2303 (localedir.h, localedir.hs): New rules.
2304 (clean): Use rm -rf to remove directories.
2305 (distclean): Also delete localedir.h and localedir.hs.
2306 (init.o): Update dependencies.
2307
88fa57d7
KC
23082004-09-22 Kelley Cook <kcook@gcc.gnu.org>
2309
2310 * Makefile.in (aclocal.m4): Update dependencies.
2311 * configure.ac (AC_CONFIG_MACRO_DIR): New.
2312 * aclocal.m4, configure: Regenerate.
2313
8f8e9aa5
ZW
23142004-09-17 Zack Weinberg <zack@codesourcery.com>
2315
a29f62d9
ZW
2316 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
2317 (_cpp_convert_input, _cpp_default_encoding): Add comments.
2318 Some other comments in this file also tweaked.
2319
8f8e9aa5
ZW
2320 * directives.c (do_pragma): Save current buffer position
2321 before lexing the pragma keywords; don't call
2322 _cpp_backup_tokens in the defer_pragmas case.
2323
a2981930
PB
23242004-09-15 Per Bothner <per@bothner.com>
2325
2326 * include/line-map.h (line_map_start): Add parameter names so
2327 preceding comment makes sense.
2328 (linemap_add): Remove from comment mention of non-existing parameter.
2329
21b11495
ZW
23302004-09-09 Matt Austern <austern@apple.com>
2331 Zack Weinberg <zack@codesourcery.com>
2332
2333 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
2334 prefixes throughout. Add entry for PRAGMA. Remove
2335 unnecessary "= 0" from EQ.
2336 (enum cpp_ttype): Adjust OP and TK definitions to restore
2337 prefixes, via token-paste.
2338 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
2339 Change from #defines to additional cpp_ttype enumerators.
2340 (struct cpp_options): Add defer_pragmas.
2341 (cpp_handle_deferred_pragma): Prototype new interface.
2342
2343 * internal.h (struct cpp_reader): Add directive_result.
2344 * directives.c (struct pragma_entry): Add is_internal field;
2345 give boolean fields type bool.
2346 (start_directive): Initialize pfile->directive_result.type.
2347 (_cpp_do__Pragma): Likewise.
2348 (run_directive): Do not crash if pfile->buffer->prev is NULL.
2349 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
2350 from it.
2351 (register_pragma): New static function, bulk of former
2352 cpp_register_pragma here; add 'internal' argument, pass along
2353 to insert_pragma_entry.
2354 (cpp_register_pragma): Now a wrapper around register_pragma which
2355 always passes false for 'internal' argument.
2356 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
2357 true for 'internal'.
2358 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
2359 an internal pragma, save text till the end of the line as a CPP_PRAGMA
2360 token instead of executing the pragma.
2361 (cpp_handle_deferred_pragma): New interface.
2362 * lex.c (token_spellings): Adjust OP and TK definitions to
2363 match changes to cpplib.h.
2364 (_cpp_lex_token): Check for a directive-result token and
2365 return it if present.
2366 (cpp_token_val_index): Handle CPP_PRAGMA.
2367 * macro.c (cpp_builtin_macro_text): Correct comment.
2368 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
2369
0fd9e8dd
SB
23702004-09-06 Serge Belyshev <belyshev@lubercy.com>
2371
2372 PR preprocessor/14699
2373 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
2374 from size_t to double.
2375
39b8ce7f
AS
23762004-08-28 Andreas Schwab <schwab@suse.de>
2377 Andreas Jaeger <aj@suse.de>
2378
2379 * configure.ac: Set PACKAGE correctly.
2380 * configure: Regenerated.
2381
5d1f4b27
PB
23822004-08-25 Paolo Bonzini <bonzini@gnu.org>
2383
2384 * Makefile.in: Add back top_builddir.
2385
078e3ffe
PB
23862004-08-25 Paolo Bonzini <bonzini@gnu.org>
2387
2388 * configure.ac: Replace Automake macro invocations
2389 with manual Autoconf checks and substitutions.
2390 * configure: Regenerate.
2391 * aclocal.m4: Regenerate.
2392 * config.in: Regenerate.
2393 * Makefile.am: Removed.
2394 * Makefile.in: Heavy simplification and reorganization.
2395
b3f8d95d
MM
23962004-08-09 Mark Mitchell <mark@codesourcery.com>
2397
2398 * configure.ac (arm*-*-eabi*): New target.
2399 (arm*-*-symbianelf*): Likewise.
2400 * configure: Regenerated.
2401
72bb2c39
BI
24022004-07-24 Bernardo Innocenti <bernie@develer.com>
2403
2404 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
2405 * directives.c: Use XNEW-family macros from libiberty.
2406 * lex.c: Likewise.
2407 * macro.c: Likewise.
2408 * cpplib.h (cpp_deps_style): Export enum with name.
2409
21b11495 24102004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 2411
21b11495 2412 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 2413
a23ee064
AP
24142004-07-16 Andris Pavenis <pavenis@latnet.lv>
2415
2416 PR preprocessor/16366
2417 * internal.h (struct cpp_reader): New field dir_hash.
2418 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
2419 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
2420
a09d4744
NB
24212004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
2422
2423 PR preprocessor/16192
2424 PR preprocessor/15913
2425 PR preprocessor/15572
2426 * expr.c (_cpp_parse_expr): Handle remaining cases where an
2427 expression is missing.
2428 * init.c (post_options): Traditional cpp doesn't do // comments.
2429
f58f7def
PB
24302004-06-30 Per Bothner <per@bothner.com>
2431
2432 * include/line-map.h (fileline): Remove old typedef.
2433 * internal.h (struct cpp_reader): Use source_location typedef instead.
2434
e83d8d43
ZW
24352004-06-26 Zack Weinberg <zack@codesourcery.com>
2436
2437 Partially revert patch of 2004-06-05.
2438 * files.c (search_cache): Remove pfile argument. Don't check
2439 for file that would be found by "" or <> search here...
2440 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
2441 Do not apply directory-of-current-file correction to files
2442 found by this check. Rearrange code slightly.
2443
c0d578e6
GK
24442004-06-21 Geoffrey Keating <geoffk@apple.com>
2445
2446 * files.c (should_stack_file): Correct swapped parameters to call
2447 to cb.read_pch.
2448 * pch.c (cpp_valid_state): Handle -fpreprocessed.
2449
159d5224
PB
24502004-06-15 Paolo Bonzini <bonzini@gnu.org>
2451
2452 * Makefile.in: Regenerate with automake 1.8.5.
2453 * aclocal.m4: Likewise.
2454 * configure: Regenerate.
2455
2fac9c01
ZW
24562004-06-11 Zack Weinberg <zack@codesourcery.com>
2457
2458 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
2459 * configure, config.in: Regenerate.
2460 * system.h: Unconditionally define bool as unsigned char,
2461 BOOL_BITFIELD as unsigned int.
2462 * .cvsignore: New file.
2463
d8044160
GK
24642004-06-09 Geoffrey Keating <geoffk@apple.com>
2465
2466 * traditional.c (push_replacement_text): Set macro->traditional.
2467 (save_replacement_text): Likewise.
2468 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
2469 (struct save_macro_item): Delete.
2470 (struct save_macro_data): Use a character array not the previous
2471 structured format.
2472 (save_macros): Save macro as text not as internal structures.
2473 (cpp_prepare_state): Update for changes to save_macro_data.
2474 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 2475 -D macros as text.
d8044160
GK
2476 * macro.c (create_iso_definition): Honour alloc_subobject.
2477 Clear traditional flag.
2478 (_cpp_create_definition): Honour alloc_subobject.
2479 * lex.c (cpp_token_val_index): New.
2480 * internal.h: Include cpp-id-data.h.
2481 (uchar): Move definition to cpp-id-data.h.
2482 (U): Likewise.
2483 (cpp_macro): Likewise.
2484 * directives.c (struct answer): Move to cpp-id-data.h.
2485 (do_assert): Honour alloc_subobject.
2cf22451
ZW
2486
2487 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
2488 * include/cpplib.h (struct cpp_string): Add GTY marker.
2489 (enum cpp_token_fld_kind): New.
2490 (struct cpp_token): Add GTY markers.
2491 (cpp_token_val_index): Prototype.
2492 (CPP_HASHNODE_VALUE_IDX): New.
2493 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
2494 * include/cpp-id-data.h: New file.
d8044160 2495
0ca8e815
PB
24962004-06-09 Paolo Bonzini <bonzini@gnu.org>
2497
2498 * Makefile.am (all-local): New.
2499 * Makefile.in: Regenerate.
2500
b51fa00f
RS
25012004-06-06 Roger Sayle <roger@eyesopen.com>
2502
2503 * Makefile.am (LIBICONV): Declare.
2504 (makedepend_LDADD): Use LIBICONV.
2505 * Makefile.in: Regenerate.
2506
5e2f3f39
AP
25072004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
2508
2509 * Makefile.am (LIBINTL): Declare
2510 (makedepend_LDADD): Use LIBINTL.
2511 * Makefile.in: Regenerate.
2512
c6e83800
ZW
25132004-06-05 Zack Weinberg <zack@codesourcery.com>
2514
2515 * Makefile.am: Add makedepend.
2516 * Makefile.in, aclocal.m4: Regenerate.
2517 * charset.c: Insert a space to avoid a warning.
2518 * directives.c: Include mkdeps.h.
2519 (_cpp_handle_directive): Reenable macro expander if appropriate.
2520 (undefine_macros): Inline body of _cpp_free_definition for speed.
2521 Do not call undef callback or _cpp_warn_if_unused_macro.
2522 (cpp_get_deps): New interface.
2523 * files.c (search_cache): Add pfile argument. Check for file
2524 that would be found by "" or <> search here...
2525 (_cpp_find_file): ...not here. Correct recorded start_dir of
2526 files found by directory-of-current-file search that would be
2527 found by "" or <> search.
2528 * init.c (cpp_add_dependency_target): Delete.
2529 * internal.h (struct lexer_state): Add discarding_output flag.
2530 * lex.c (lex_identifier): Compute hash function while scanning.
2531 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
2532 directives.
2533 * makedepend.c: New file.
2534 * mkdeps.c (struct deps): Add vpath vector.
2535 (apply_vpath, deps_add_vpath): New function.
2536 (deps_free): Free vpath vector.
2537 (deps_add_dep, deps_add_target): Use apply_vpath.
2538 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
2539 (ht_lookup_with_hash): New function.
2540 * cpplib.h, mkdeps.h: Update prototypes.
2541 * symtab.h: Update prototypes.
2542 (HT_HASHSTEP, HT_FINISH): New macros.
2543
b453c95f
GK
25442004-05-29 Geoffrey Keating <geoffk@apple.com>
2545
2546 * symtab.c (ht_create): Set entries_owned.
2547 (ht_destroy): Honour entries_owned.
2548 (ht_expand): Likewise.
2549 (ht_load): New.
2cf22451
ZW
2550 * include/symtab.h (struct ht): New field 'entries_owned'
2551 (ht_load): New prototype.
b453c95f 2552
963e23c5
PB
25532004-05-26 Paolo Bonzini <bonzini@gnu.org>
2554
2555 PR bootstrap/15651
2556 * configure.ac: Fix m4 quoting when picking
2557 the size of HOST_WIDE_INT.
2558 * configure: Regenerate.
2559
0429bc77
PB
25602004-05-25 Paolo Bonzini <bonzini@gnu.org>
2561
2562 * Makefile.am: the correct directory for
2563 gettext include files is given by @INCINTL@.
2564 * Makefile.in: Regenerate.
2565
c86dd7db
PB
25662004-05-24 Paolo Bonzini <bonzini@gnu.org>
2567
2568 * system.h [!ENABLE_NLS]: dgettext takes two
2569 parameters.
2570
4f4e53dd
PB
25712004-05-23 Paolo Bonzini <bonzini@gnu.org>
2572
2573 Moved libcpp from the gcc subdirectory to the toplevel.
2574 * Makefile.am: New file.
2575 * Makefile.in: Regenerate.
2576 * configure.ac: New file.
2577 * configure: Regenerate.
2578 * config.in: Regenerate.
2579 * charset.c: Moved from gcc/cppcharset.c. Add note about
2580 brokenness of input charset detection. Adjust for change
2581 in name of cppucnid.h.
2582 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
2583 * expr.c: Moved from gcc/cppexp.c.
2584 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
2585 Remove #define of O_BINARY, it is in system.h.
2586 * identifiers.c: Moved from gcc/cpphash.c.
2587 * internal.h: Moved from gcc/cpphash.h. Change header
2588 guard name. All other files adjusted to match name change.
2589 * init.c: Moved from gcc/cppinit.c.
2590 (init_library) [ENABLE_NLS]: Call bindtextdomain.
2591 * lex.c: Moved from gcc/cpplex.c.
2592 * directives.c: Moved from gcc/cpplib.c.
2593 * macro.c: Moved from gcc/cppmacro.c.
2594 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
2595 * traditional.c: Moved from gcc/cpptrad.c.
2596 * ucnid.h: Moved from gcc/cppucnid.h. Change header
2597 guard name.
2598 * ucnid.pl: Moved from gcc/cppucnid.pl.
2599 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
2600 guard name.
2601 * symtab.c: Moved from gcc/hashtable.c.
2602 * line-map.c: Moved from gcc. Do not include intl.h.
2603 * mkdeps.c: Moved from gcc.
2604 * system.h: New file.
2cf22451
ZW
2605 * include/cpplib.h: Moved from gcc. Change header guard name.
2606 * include/line-map.h: Moved from gcc. Change header guard name.
2607 * include/mkdeps.h: Moved from gcc. Change header guard name.
2608 * include/symtab.h: Moved from gcc/hashtable.h. Change header
2609 guard name.