]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
2011-10-17 Richard Guenther <rguenther@suse.de>
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
1ae3520e 12011-10-15 Tom Tromey <tromey@redhat.com>
2 Dodji Seketeli <dodji@redhat.com>
3
4 * include/line-map.h (struct line_maps::alloced_size_for_request):
5 New member.
6 * line-map.c (new_linemap): Use set->alloced_size_for_request to
7 get the actual allocated size of line maps.
8
e77b8253 92011-10-15 Tom Tromey <tromey@redhat.com>
10 Dodji Seketeli <dodji@redhat.com>
11
12 * line-map.h (struct linemap_stats): Declare new struct.
13 (linemap_get_statistics): Declare ...
14 * line-map.c (linemap_get_statistics): ... new function.
15 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
16 Declare new counters.
17 (enter_macro_context, replace_args): Update
18 num_macro_tokens_counter.
19 (cpp_get_token_1): Update num_expanded_macros_counter.
20
62db153a 212011-10-15 Tom Tromey <tromey@redhat.com>
22 Dodji Seketeli <dodji@redhat.com>
23
24 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
25 * include/line-map.h (linemap_dump_location): Declare ...
26 * line-map.c (linemap_dump_location): ... new function.
27
ce70f433 282011-10-15 Tom Tromey <tromey@redhat.com>
29 Dodji Seketeli <dodji@redhat.com>
30
31 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
32 New option.
33 * internal.h (struct macro_context): New struct.
34 (enum context_tokens_kind): New enum.
35 (struct cpp_context)<tokens_kind>: New member of type enum
36 context_tokens_kind.
37 (struct cpp_context)<macro>: Remove this. Replace it with an enum
38 of macro and macro_context.
39 (struct cpp_context)<direct_p>: Remove.
40 (_cpp_remaining_tokens_num_in_context): Declare new function.
41 * directives.c (destringize_and_run): Adjust.
42 * lex.c (_cpp_remaining_tokens_num_in_context)
43 (_cpp_token_from_context_at): Define new functions
44 (cpp_peek_token): Use them.
45 * init.c (cpp_create_reader): Initialize the base context to zero.
46 (_cpp_token_from_context_at): Define new static function.
47 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
48 _cpp_token_from_context_at.
49 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
50 members.
51 (enum macro_arg_token_kind): New enum.
52 (struct macro_arg_token_iter): New struct.
53 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
54 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
55 (delete_macro_args, set_arg_token, get_arg_token_location)
56 (arg_token_ptr_at, macro_arg_token_iter_init)
57 (macro_arg_token_iter_get_token)
58 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
59 (expanded_token_index, tokens_buff_new, tokens_buff_count)
60 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
61 (tokens_buff_add_token, tokens_buff_remove_last_token)
62 (reached_end_of_context, consume_next_token_from_context): New
63 static functions.
64 (cpp_get_token_1): New static function. Split and extended from
65 cpp_get_token. Use reached_end_of_context and
66 consume_next_token_from_context. Unify its return point. Move
67 the location tweaking from cpp_get_token_with_location in here.
68 (cpp_get_token): Use cpp_get_token_1
69 (stringify_arg): Use the new arg_token_at.
70 (paste_all_tokens): Support tokens coming from extended tokens
71 contexts.
72 (collect_args): Return the number of collected arguments, by
73 parameter. Store virtual locations of tokens that constitute the
74 collected args.
75 (funlike_invocation_p): Return the number of collected arguments,
76 by parameter.
77 (enter_macro_context): Add a parameter for macro expansion point.
78 Pass it to replace_args and to the "used" cpp callback. Get the
79 number of function-like macro arguments from funlike_invocation_p,
80 pass it to the new delete_macro_args to free the memory used by
81 macro args. When -ftrack-macro-expansion is in effect, for macros
82 that have no arguments, create a macro map for the macro expansion
83 and use it to allocate proper virtual locations for tokens
84 resulting from the expansion. Push an extended tokens context
85 containing the tokens resulting from macro expansion and their
86 virtual locations.
87 (replace_args): Rename the different variables named 'count' into
88 variables with more meaningful names. Create a macro map;
89 allocate virtual locations of tokens resulting from this
90 expansion. Use macro_arg_token_iter to iterate over tokens of a
91 given macro. Handle the case of the argument of
92 -ftrack-macro-expansion being < 2. Don't free macro arguments
93 memory resulting from expand_arg here, as these are freed by the
94 caller of replace_arg using delete_macro_args now. Push extended
95 token context.
96 (next_context, push_ptoken_context, _cpp_push_token_context)
97 (_cpp_push_text_context): Properly initialize the context.
98 (expand_arg): Use the new alloc_expanded_arg_mem,
99 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
100 (_cpp_pop_context): Really free the memory held by the context.
101 Handle freeing memory used by extended tokens contexts.
102 (cpp_get_token_with_location): Use cpp_get_token_1.
103 (cpp_sys_macro_p): Adjust.
104 (_cpp_backup_tokens): Support the new kinds of token contexts.
105 * traditional.c (recursive_macro): Adjust.
106
97bfb9ef 1072011-10-15 Tom Tromey <tromey@redhat>
108 Dodji Seketeli <dodji@redhat.com>
109
110 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
111 member.
112 (MAX_SOURCE_LOCATION): New constant.
113 (struct line_map_ordinary, struct line_map_macro): New structs.
114 (struct line_map): Turn this into a union of the two above. Add
115 comments.
116 (struct maps_info): New struct.
117 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
118 These now carry the map information that was previously scattered
119 in struct line_maps.
120 (struct map_info::allocated): Fix comment.
121 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
122 (ORDINARY_MAP_STARTING_LINE_NUMBER)
123 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
124 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
125 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
126 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
127 (MACRO_MAP_EXPANSION_POINT_LOCATION)
128 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
129 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
130 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
131 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
132 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
133 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
134 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
135 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
136 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
137 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
138 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
139 information.
140 (linemap_check_ordinary, linemap_assert)
141 (linemap_location_before_p): New macros.
142 (linemap_position_for_line_and_column)
143 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
144 (linemap_macro_expansion_map_p)
145 (linemap_macro_map_loc_to_def_point)
146 (linemap_macro_map_loc_unwind_once)
147 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
148 (linemap_get_source_line linemap_get_source_column)
149 (linemap_map_get_macro_name, linemap_get_file_path)
150 (linemap_location_in_system_header_p)
151 (linemap_location_from_macro_expansion_p): Declare new functions.
152 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
153 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
154 accessors act on ordinary maps only.
155 (INCLUDED_FROM): Return NULL for main files; use the new
156 accessors.
157 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
158 (struct expanded_location): Move here from gcc/input.h
159 (linemap_resolve_location, linemap_expand_location)
160 (linemap_expand_location_full): Declare new functions.
161 * line-map.c: Include cpplib.h, internal.h
162 (linemap_enter_macro, linemap_add_macro_token)
163 (linemap_get_expansion_line, linemap_get_expansion_filename): New
164 functions that are private to libcpp.
165 (linemap_assert): New macro.
166 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
167 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
168 (linemap_macro_map_loc_unwind_toward_spelling)
169 (linemap_macro_map_loc_to_exp_point)
170 (first_map_in_common_1, first_map_in_common): New static
171 functions.
172 (new_linemap): Define new static functions. Extracted and
173 enhanced from ...
174 (linemap_add): ... here. Use linemap_assert in lieu of abort
175 previously.
176 (linemap_tracks_macro_expansion_locs_p)
177 (linemap_add_macro_token, linemap_macro_expansion_map_p)
178 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
179 (linemap_macro_map_loc_to_def_point)
180 (linemap_macro_map_loc_unwind_once)
181 (linemap_step_out_once, linemap_map_get_index)
182 (linemap_get_source_line,linemap_get_source_column)
183 (linemap_get_file_path, linemap_map_get_macro_name)
184 (linemap_location_in_system_header_p)
185 (linemap_location_originated_from_system_header_p)
186 (linemap_location_from_macro_expansion_p)
187 (linemap_tracks_macro_expansion_locs_p)
188 (linemap_resolve_location, linemap_expand_location)
189 (linemap_expand_location_full)
190 (linemap_tracks_macro_expansion_locs_p)
191 (linemap_position_for_line_and_column, linemap_compare_locations):
192 Define new public functions.
193 (linemap_init): Initialize ordinary and macro maps information in
194 the map set.
195 (linemap_check_files_exited): Use the new accessors.
196 (linemap_free): Remove this dead code.
197 (linemap_line_start): Assert this uses an ordinary map. Adjust to
198 use the new ordinary map accessors and data structures. Don't
199 overflow past the lowest possible macro token's location.
200 (linemap_position_for_column): Assert the ordinary maps of the map
201 set are really ordinary. Use ordinary map accessors.
202 (linemap_lookup): Keep the same logic but generalize to allow
203 lookup of both ordinary and macro maps. Do not crash when called
204 with an empty line table.
205 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
206 new API of line-map.h.
207 * directives.c (start_directive, do_line, do_linemarker)
208 (do_linemarker): Likewise.
209 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
210 (make_cpp_dir, cpp_make_system_header): Likewise.
211 * init.c (cpp_read_main_file): Likewise.
212 * internal.h (CPP_INCREMENT_LINE): Likewise.
213 (linemap_enter_macro, linemap_add_macro_token)
214 (linemap_get_expansion_line, linemap_get_expansion_filename): New
215 functions private to libcpp.
216 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
217 (skip_line_comment, skip_whitespace, lex_raw_string)
218 (_cpp_lex_direct): Likewise.
219 * macro.c (_cpp_builtin_macro_text): Likewise.
220 (_cpp_aligned_alloc): Initialize the new name member of the macro.
221 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
222 Likewise.
223 * errors.c (cpp_diagnostic): Adjust to new linemap API.
224
1dc92c59 2252011-08-28 Dodji Seketeli <dodji@redhat.com>
226
227 * line-map.c (linemap_add): Assert that reason must not be
228 LC_RENAME when called for the first time on a "main input file".
229
6ea2c7a3 2302011-08-22 Gabriel Charette <gchare@google.com>
231
232 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
233 * internal.h (struct cpp_reader): Add field forced_token_location_p.
234 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
235 (cpp_force_token_locations): New.
236 (cpp_stop_forcing_token_locations): New.
237
985e7f10 2382011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
239
240 PR libstdc++/1773
241 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
242
094a55ba 2432011-08-18 Joseph Myers <joseph@codesourcery.com>
244
245 * include/cpplib.h (struct cpp_options): Fix typo.
246
6f6f3dd7 2472011-08-18 Joseph Myers <joseph@codesourcery.com>
248
249 * include/cpplib.h (struct cpp_options): Add rliterals.
250 * init.c (struct lang_flags, lang_defaults): Add rliterals.
251 (cpp_set_lang): Set rliterals option.
252 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
253 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
254
80ea6373 2552011-08-15 Gabriel Charette <gchare@google.com>
256
257 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
258 Update all users to use linemap_position_for_column instead.
259
d44dc666 2602011-07-28 Gabriel Charette <gchare@google.com>
261
262 * include/line-map.h (struct line_maps):
263 Remove unused field last_listed. Update all users.
264
6b4db1bd 2652011-07-28 H.J. Lu <hongjiu.lu@intel.com>
266
267 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
268 * configure: Regenerated.
269
80e4662c 2702011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
271
272 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
273
6678cb4e 2742011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
275 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
276
277 PR bootstrap/49794
278 * configure.ac: Test AM_ICONV with CXX.
279 * configure: Regenerate.
280 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
281
c219ee5c 2822011-07-15 Dodji Seketeli <dodji@redhat.com>
283
284 * directives.c (struct if_stack): Use source_location as type
285 here.
286 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
287 indent, def_pragma, used_define, used_undef>: Properly use
288 source_location as parameter type, rather than unsigned int.
289
14f27bc6 2902011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
291
292 PR target/39150
293 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
294 like i[34567]86-*-solaris2.1[0-9]*.
295 * configure: Regenerate.
296
414663ef 2972011-06-16 Jason Merrill <jason@redhat.com>
298
299 PR c++/45399
300 * lex.c (lex_raw_string): Don't check for embedded NUL.
301
2c694d44 3022011-06-06 Dodji Seketeli <dodji@redhat.com>
303
304 PR preprocessor/48532
305 * directives.c (do_pragma): Don't forget the invocation location
306 when parsing the pragma name of a namespaced pragma directive.
307
9793dd8e 3082011-05-29 John Tytgat <John.Tytgat@aaug.net>
309
310 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
311
cef70b8a 3122011-05-22 Uros Bizjak <ubizjak@gmail.com>
313
314 PR target/49104
315 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
316 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
317
cdd0bb4b 3182011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
319
320 * system.h (ENUM_BITFIELD): Remove.
321
0ff0cd04 3222011-04-24 Jakub Jelinek <jakub@redhat.com>
323
324 PR preprocessor/48740
325 * lex.c (lex_raw_string): When raw string ends with
326 ??) followed by raw prefix and ", ensure it is preprocessed
327 with ??) rather than ??].
328
dd045aee 3292011-04-20 Jim Meyering <meyering@redhat.com>
330
331 * files.c (destroy_cpp_file): Remove useless if-before-free.
332 * init.c (cpp_destroy): Likewise.
333 * macro.c (replace_args): Likewise.
334 * pch.c (cpp_valid_state): Likewise.
335
bb7824b5 3362011-03-25 Kai Tietz <ktietz@redhat.com>
337
338 * files.c (file_hash_eq): Use filename_cmp
339 instead of strcmp.
340 (nonexistent_file_hash_eq): Likewise.
341 (remap_filename): Likewise.
342 Handle absolute DOS-path,
343 (append_file_to_dir): Check for IS_DIR_SEPARATOR
344 instead of slash.
345 (read_name_map): Likewise.
346 * linemap.c (linemap_add): Use filename_cmp
347 instead of strcmp.
348 * mkdeps.c (apply_vpath): Use filename_ncmp
349 instead of strncmp.
350 (deps_restore): Use filename_cmp instead of
351 strcmp.
352 * init.c (read_original_directory): Use
353 IS_DIR_SEPARATOR instead of checking for slash.
354
00e59df9 3552011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
356
357 PR preprocessor/48192
358 * directives.c (do_ifdef): Do not consider conditional macros as
359 being defined.
360 (do_ifndef): Ditto.
361 * expr.c (parse_defined): Ditto.
362
70ebee13 3632011-03-18 Richard Henderson <rth@redhat.com>
364
365 PR bootstrap/45381
366 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
367
65861c3e 3682011-11-04 Eric Botcazou <ebotcazou@adacore.com>
369 Jakub Jelinek <jakub@redhat.com>
370
371 PR preprocessor/39213
372 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
373 pragmas as well in traditional mode.
374
be04fdf9 3752010-11-17 Ian Lance Taylor <iant@google.com>
376
377 PR bootstrap/45538
378 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
379 AC_LANG based on ENABLE_BUILD_WITH_CXX.
380
560ab0b2 3812010-11-16 Kai Tietz <kai.tietz@onevision.com>
382
383 PR preprocessor/17349
384 * lex.c (save_comment): Handle in argument passing c++
385 comments special.
386
075f1161 3872010-11-02 Ian Lance Taylor <iant@google.com>
388
389 * configure.ac: Use AC_SYS_LARGEFILE.
390 * configure: Rebuild.
391 * config.in: Rebuild.
392
bc3d3e89 3932010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
075f1161 394
bc3d3e89 395 * line-map.h (source_location): Remove obsolete comment
396 mentioning location_s.
397
0d601ff4 3982010-09-29 Kai Tietz <kai.tietz@onevision.com>
399
400 PR preprocessor/45362
401 * directives.c (cpp_pop_definition): Make static.
402 (do_pragma_push_macro): Reworked to store text
403 definition.
404 (do_pragma_pop_macro): Add free text definition.
405 (cpp_push_definition): Removed.
406 * include/cpplib.h (cpp_push_definition): Removed.
407 (cpp_pop_definition): Likewise.
408 * internal.h (def_pragma_macro): Remove member 'value'
409 and add new members 'definition', 'line',
410 'syshdr', 'sued' and 'is_undef'.
411 * pch.c (_cpp_restore_pushed_macros): Rework to work
412 on text definition and store additional macro flags.
413 (_cpp_save_pushed_macros): Likewise.
414
5ae82d58 4152010-09-29 Joseph Myers <joseph@codesourcery.com>
416
417 * include/cpplib.h (cpp_options): Rename warn_deprecated,
418 warn_traditional, warn_long_long and pedantic.
419 * directives.c (directive_diagnostics, _cpp_handle_directive):
420 Update names of cpp_options members.
421 * expr.c (cpp_classify_number, eval_token): Update names of
422 cpp_options members.
423 * init.c (cpp_create_reader, post_options): Update names of
424 cpp_options members.
425 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
426 cpp_options members.
427 * macro.c (parse_params): Update names of cpp_options members.
428
ced52ffd 4292010-09-15 Ian Lance Taylor <iant@google.com>
430
431 * init.c: Fix type name in comment.
432
df863d33 4332010-08-31 Jakub Jelinek <jakub@redhat.com>
434
435 PR preprocessor/45457
436 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
437 needed.
438 * directives.c (do_ifdef, do_ifndef): Likewise.
439
9e76b586 4402010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
441
442 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
443
b315ae35 4442010-08-24 Richard Henderson <rth@redhat.com>
445
446 PR bootstrap/45376
447 * configure.ac (HAVE_SSE4): New check.
448 * configure, config.in: Rebuild.
449 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
450
8ab29ece 4512010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
452
453 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
454 etc. on Solaris 2/x86.
455
2431e8ba 4562010-08-21 Richard Henderson <rth@redhat.com>
457 Andi Kleen <ak@linux.intel.com>
458 David S. Miller <davem@davemloft.net>
459
460 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
461 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
462 (ptrdiff_t): Check via AC_CHECK_TYPE.
463 * config.in, configure: Rebuild.
464 * system.h: Include stdint.h, if available.
465 * lex.c (WORDS_BIGENDIAN): Provide default.
466 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
467 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
468 search_line_sse2, search_line_sse42, init_vectorized_lexer,
469 search_line_fast): New.
470 (_cpp_clean_line): Use search_line_fast. Restructure the fast
471 loop to make it clear when we're leaving the loop. Stay in the
472 fast loop for non-trigraph '?'.
473
25692381 4742010-06-11 Jakub Jelinek <jakub@redhat.com>
475
476 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
477 callback.
478 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
479 (cpp_macro_definition): Remove const qual from second argument.
480 * macro.c (enter_macro_context): Call user_builtin_macro callback for
481 NODE_BUILTIN !NODE_USED macros.
482 (warn_of_redefinition): Likewise. Remove const qual from second
483 argument.
484 (cpp_macro_definition): Likewise.
485 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
486 for NODE_BUILTIN !NODE_USED macros.
487
abf6a617 4882010-06-10 Joseph Myers <joseph@codesourcery.com>
489
490 * include/cpplib.h (struct cpp_options): Remove show_column.
491 * init.c (cpp_create_reader, post_options): Don't set show_column.
492
9d135bb6 4932010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
494
495 PR bootstrap/44432
496 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
497 check that C++ compiler works.
498 * configure: Regenerate.
499
ba72912a 5002010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
501
502 * include/symtab.h (ht_identifier_ptr): New.
503
050318d9 5042010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
505 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
506
507 PR bootstrap/42798
508 * configure.ac: Check for declaration of 'basename(char *)'.
509 * configure: Regenerate.
510 * config.in: Regenerate.
511
39012afb 5122010-04-25 Joseph Myers <joseph@codesourcery.com>
513
514 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
515 * init.c (lang_defaults): Add entries for new language variants.
516 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
517 variants.
518
721e9705 5192010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
520
521 PR cpp/43195
522 * files.c (report_missing_guard): Test for #pragma once.
523
3a79f5da 5242010-04-07 Simon Baldwin <simonb@google.com>
525
526 * directives.c (do_diagnostic): Add warning reason argument,
527 call appropriate error reporting function for code.
528 (directive_diagnostics): Call specific warning functions with
529 warning reason where appropriate.
530 (do_error, do_warning, do_pragma_dependency): Add warning reason
531 argument to do_diagnostic calls.
532 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
533 _cpp_create_definition): Call specific warning functions with
534 warning reason where appropriate.
535 * Makefile.in: Add new diagnostic functions to gettext translations.
536 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
537 to error callback.
538 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
539 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
540 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
541 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
542 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
543 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
544 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
545 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
546 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
547 warning reason codes.
548 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
549 cpp_warning_with_line, cpp_pedwarning_with_line,
550 cpp_warning_with_line_syshdr): New specific error reporting functions.
551 * pch.c (cpp_valid_state): Call specific warning functions with
552 warning reason where appropriate.
553 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
554 diagnostic handlers.
555 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
556 cpp_warning_with_line, cpp_pedwarning_with_line,
557 cpp_warning_with_line_syshdr): New specific error reporting functions.
558 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
559 specific warning functions with warning reason where appropriate.
560 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
561 warn_about_normalization, lex_identifier_intern, lex_identifier,
562 _cpp_lex_direct): Ditto.
563 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
564 narrow_str_to_charconst): Ditto.
565
56e2ce2d 5662010-04-06 Jakub Jelinek <jakub@redhat.com>
567
568 PR preprocessor/43642
569 * lex.c (lex_raw_string): Change type of TYPE variable to
570 unsigned char.
571
e0934084 5722010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
573
574 * aclocal.m4: Regenerate.
575
7fe0ef3a 5762010-03-29 Jason Merrill <jason@redhat.com>
577
3a45011c 578 More N3077 raw string changes
579 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
580 strings.
581 * lex.c (bufring_append): Split out from...
582 (lex_raw_string): ...here. Undo trigraph and line splicing
583 transformations. Do process line notes in multi-line literals.
584 (_cpp_process_line_notes): Ignore notes that were already handled.
585
7fe0ef3a 586 Some raw string changes from N3077
587 * charset.c (cpp_interpret_string): Change inner delimiters to ().
588 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
589
65f40615 5902010-02-11 Jakub Jelinek <jakub@redhat.com>
591
592 * init.c (read_original_filename): Don't call read_original_directory
593 if _cpp_handle_directive returns 0.
594
0074cd57 5952010-01-01 Joseph Myers <joseph@codesourcery.com>
596
597 PR preprocessor/41947
598 * expr.c (cpp_classify_number): Give error for hexadecimal
599 floating-point constant with no digits before or after point.
600
116f0a5f 6012009-11-20 Arnaud Charlet <charlet@adacore.com>
602
603 * macro.c (enter_macro_context): Call cb.used callback if defined.
604 * directives.c (do_idef, do_ifndef): Ditto.
605 * include/cpplib.h (struct cpp_callbacks): Add used callback.
606
038c21f1 6072009-11-11 Kai Tietz <kai.tietz@onevision.com>
608
609 * directives.c (do_pragma_push_macro): New pragma handler.
610 (do_pragma_pop_macro): Likewise.
611 (_cpp_init_internal_pragmas): Add push_macro and
612 pop_macro handler to internal pragmas.
613 (lex_macro_node_from_str): Removed.
614 (cpp_push_definition): Replace lex_macro_node_from_str
615 by _cpp_lex_identifier.
616 (cpp_pop_definition): Likewise.
617 * internal.h (_cpp_lex_identifier): New prototype.
618 (def_pragma_macro): New structure.
619 (cpp_reader): New member pushed_macros.
620 * lex.c (_cpp_lex_identifier): New function.
621 (lex_identifier_intern): New function.
622 * init.c (cpp_create_reader): Initialize pushed_macros
623 member.
624 (cpp_destroy): Free elements in pushed_macros member.
625 * pch.c (_cpp_save_pushed_macros): New function.
626 (_cpp_restore_pushed_macros): Likewise.
627 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
628 (cpp_read_state): Use _cpp_restore_pushed_macros.
629
538ba11a 6302009-10-19 Jakub Jelinek <jakub@redhat.com>
631
632 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
633 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
634 and char32_cset_desc.
635 (converter_for_type): Handle CPP_UTF8STRING.
636 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
637 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
638 (parse_include): Reject raw strings.
639 * include/cpplib.h (CPP_UTF8STRING): New token type.
640 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
641 * lex.c (lex_raw_string): New function.
642 (lex_string): Handle u8 string literals, call lex_raw_string
643 for raw string literals.
644 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
645 sequences.
646 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
647
af4d2883 6482009-10-14 Jakub Jelinek <jakub@redhat.com>
649
650 PR preprocessor/41543
651 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
652 * line-map.c (linemap_init): Initialize highest_location and
653 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
654
8e83a065 6552009-10-09 Jason Merrill <jason@redhat.com>
656
657 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
658
8f2ff12e 6592009-10-09 Neil Vachharajani <nvachhar@google.com>
660
661 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
662 sccs.
663
fc25a827 6642009-09-23 Loren J. Rittle <ljrittle@acm.org>
665
666 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
667 * configure: Rebuilt.
668
fa12a6a5 6692009-09-22 Richard Guenther <rguenther@suse.de>
670
671 PR pch/38987
672 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
673
c25f2689 6742009-09-18 Chris Demetriou <cgd@google.com>
675
676 PR preprocessor/28435:
677 * include/cpplib.h (struct cpp_options): Add new member
678 deps.need_preprocessor_output.
679 * files.c (open_file_failed): If preprocessor output is needed
680 always report an error.
681
a4f7c8f7 6822009-09-13 Kai Tietz <kai.tietz@onevision.com>
683
684 * configure.ac: Set for i?86-w64-mingw*
685 need_64bit_hwint to yes.
686 * configure: Regenerated.
687
3f24af9b 6882009-09-10 Jason Merrill <jason@redhat.com>
689
690 * directives.c (cpp_define): constify.
691
2a50bfcf 6922009-09-02 Ian Lance Taylor <iant@google.com>
693
694 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
695
81a71e2b 6962009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
697
698 * configure.ac (AC_PREREQ): Bump to 2.64.
699
cd9a469c 7002009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
701
702 * aclocal.m4: Regenerate.
703 * config.in: Regenerate.
704 * configure: Regenerate.
705
ed184982 7062009-08-17 Tom Tromey <tromey@redhat.com>
707
708 PR preprocessor/41067:
709 * charset.c (convert_escape): Add missing ":" to error text.
710
7ad75c55 7112009-07-27 Douglas B Rupp <rupp@gnat.com>
712
713 * include/cpplib.h (INO_T_CPP): New macro.
714 (struct cpp_dir): Use it.
715
80b97ef3 7162009-07-20 Jerry Quinn <jlquinn@optonline.net>
717
718 PR regression/40800
719 * configure.ac: Use = instead of == for testing
720 ENABLE_BUILD_WITH_CXX.
721 * configure: Rebuild.
722
723ebaea 7232009-07-17 Jerry Quinn <jlquinn@optonline.net>
724
725 * directives.c (do_linemarker, do_line): Use CPP_STRING for
726 ignored enum value.
727 * files.c (find_file_in_dir): Add cast from void* to char*.
728 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
729 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
730 warnings.
731 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
732 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
733 COMPILER_FLAGS): New.
734 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
735 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
736 instead of ALL_CFLAGS.
737 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
738 from other warnings. Add -Wc++-compat to C-specific warnings.
739 Check for --enable-build-with-cxx. Set and substitute
740 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
741 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
742 AC_CHECK_HEADERS.
743 * configure: Rebuild.
744 * include/cpp-id-data.h: Remove extern "C".
745 * include/line-map.h: Likewise.
746 * include/mkdeps.h: Likewise.
747 * include/symtab.h: Likewise.
748 * internal.h: Likewise.
749
78ed8e3d 7502009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
751
752 * directives.c (parse_include): Add location argument. Update all
753 calls.
754 (parse_answer): Likewise.
755 (do_include_common): Error with exact location.
756 (parse_assertion): Likewise.
757
46821594 7582009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
759
760 * expr.c (num_div_op): Take explicit location.
761
52b290f1 7622009-06-17 Ian Lance Taylor <iant@google.com>
763
764 * include/cpplib.h (progname): Don't declare.
765
2a6a6991 7662009-06-12 Ian Lance Taylor <iant@google.com>
767
768 * include/cpplib.h (struct cpp_options): Add
769 warn_cxx_operator_names field.
770 (NODE_WARN_OPERATOR): Define.
771 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
772 type to 6 bits.
773 * init.c (mark_named_operators): Add flags parameter.
774 (cpp_post_options): Pick flags value to pass to
775 mark_named_operators.
776 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
777 identifier is an operator name in C++.
778
b559b9e2 7792009-06-01 Aldy Hernandez <aldyh@redhat.com>
780
781 * include/line-map.h (LAST_SOURCE_COLUMN): New.
782
e61157d7 7832009-06-01 Ian Lance Taylor <iant@google.com>
784
785 * include/cpp-id-data.h: Add extern "C".
786 * include/line-map.h: Likewise.
787 * include/mkdeps.h: Likewise.
788 * include/symtab.h: Likewise.
789 * internal.h: Likewise.
790
26dbec0a 7912009-05-15 Ian Lance Taylor <iant@google.com>
792
793 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
794 builtin_type. Change all uses.
795
5b500807 7962009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
797
798 PR cpp/36674
799 * directives (do_linemarker): Compensate for the increment in
800 location that occurs when we reach the end of line.
801 * files (_cpp_stack_include): Mention _cpp_find_file in the
802 comment.
803
2ee04baa 8042009-05-10 Joseph Myers <joseph@codesourcery.com>
805
806 * include/cpplib.h (enum cpp_token_fld_kind): Add
807 CPP_TOKEN_FLD_TOKEN_NO.
808 (struct cpp_macro_arg, struct cpp_identifier): Define.
809 (union cpp_token_u): Use struct cpp_identifier for identifiers.
810 Use struct cpp_macro_arg for macro arguments. Add token_no for
811 CPP_PASTE token numbers.
812 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
813 do_pragma_poison, parse_assertion): Use val.node.node in place of
814 val.node.
815 * expr.c (parse_defined, eval_token): Use val.node.node in place
816 of val.node.
817 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
818 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
819 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
820 place of val.arg_no. Use val.node.node in place of val.node.
821 * macro.c (replace_args, cpp_get_token, parse_params,
822 lex_expansion_token, create_iso_definition, cpp_macro_definition):
823 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
824 Use val.node.node in place of val.node.
825
49a657d9 8262009-05-03 Joseph Myers <joseph@codesourcery.com>
827
828 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
829 UTF-8 sequences.
830
9c6183dd 8312009-04-25 Joseph Myers <joseph@codesourcery.com>
832
833 PR preprocessor/39559
834 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
835 constants larger than intmax_t in C99 mode.
836
fb1e4f4a 8372009-04-21 Taras Glek <tglek@mozilla.com>
838
839 * include/cpp-id-data.h: Update GTY annotations to new syntax.
840 * include/cpplib.h: Likewise.
841 * include/line-map.h: Likewise.
842 * include/symtab.h: Likewise.
843
ba99525e 8442009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
845
846 PR c++/14875
847 * lex.c (cpp_type2name): Take a flags parameter. Call
848 cpp_named_operator2name for named operators and cpp_digraph2name
849 for digraphs.
850 (cpp_digraph2name): New.
851 (cpp_spell_token): Use it.
852 (cpp_output_token): Likewise.
853 * include/cpplib.h (cpp_type2name): Update declaration.
854 * init.c (cpp_named_operator2name): New.
855 * internal.h (cpp_named_operator2name): Declare.
856
9ab71c6b 8572009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
858
859 PR c++/13358
860 * init.c (cpp_create_reader): Wlong_long is disabled by default.
861 * expr.c (cpp_classify_number): Give different messages for C and
862 C++ front-ends.
863
941f2388 8642009-04-19 Joseph Myers <joseph@codesourcery.com>
865
866 PR preprocessor/20078
867 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
868 field.
869 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
870 (struct cpp_token): Change flags to unsigned short.
871 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
872 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
873 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
874 tokens.
875 * macro.c (macro_real_token_count): New.
876 (enter_macro_context, replace_args): Use macro_real_token_count.
877 (create_iso_definition): Record whitespace surrounding and digraph
878 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
879 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
880 multiple consecutive ## tokens.
881 (_cpp_create_definition): Initialize extra_tokens.
882 (cpp_macro_definition): Use macro_real_token_count.
883
3e52c418 8842009-04-18 Joseph Myers <joseph@codesourcery.com>
885
886 * directives.c (parse_include): Pass true to check_eol.
887
1eecdb28 8882009-04-18 Joseph Myers <joseph@codesourcery.com>
889
890 PR preprocessor/39646
891 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
892 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
893 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
894 place of LC_RENAME.
895
6cda323a 8962009-04-18 Joseph Myers <joseph@codesourcery.com>
897
898 PR preprocessor/39647
899 * directives.c (check_eol): Add parameter expand.
900 (do_undef, parse_include, do_line, do_linemarker, do_ident,
901 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
902 do_else, do_endif, do_assert, do_unassert): All callers changed.
903 Pass true from do_line, false elsewhere.
904
e21164ef 9052009-04-12 Joseph Myers <joseph@codesourcery.com>
906
907 PR preprocessor/31869
908 * macro.c (stringify_arg): Handle NULL source token in padding
909 token where previous padding token did not have source token with
910 preceding whitespace.
911
6bc9506f 9122009-04-09 Jakub Jelinek <jakub@redhat.com>
913
914 * Makefile.in: Change copyright header to refer to version
915 3 of the GNU General Public License and to point readers at the
916 COPYING3 file and the FSF's license web page.
917 * charset.c: Likewise.
918 * directives-only.c: Likewise.
919 * directives.c: Likewise.
920 * errors.c: Likewise.
921 * expr.c: Likewise.
922 * files.c: Likewise.
923 * identifiers.c: Likewise.
924 * include/cpp-id-data.h: Likewise.
925 * include/cpplib.h: Likewise.
926 * include/line-map.h: Likewise.
927 * include/mkdeps.h: Likewise.
928 * include/symtab.h: Likewise.
929 * init.c: Likewise.
930 * internal.h: Likewise.
931 * lex.c: Likewise.
932 * line-map.c: Likewise.
933 * macro.c: Likewise.
934 * makeucnid.c: Likewise.
935 * mkdeps.c: Likewise.
936 * pch.c: Likewise.
937 * symtab.c: Likewise.
938 * system.h: Likewise.
939 * traditional.c: Likewise.
940 * ucnid.tab: Likewise.
941 * ucnid.h: Regenerate.
942
5840fdcf 9432009-04-01 Janis Johnson <janis187@us.ibm.com>
944
f8ed6d41 945 PR c/39027
946 * include/cpplib.h (CPP_N_DEFAULT): Define.
947 * expr.c (interpret_float_suffix): Recognize d or D for double,
948 return new value for default.
949 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
950
5840fdcf 951 PR c/33466
952 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
953 letters from decimal float and fixed-point suffixes.
954
ff903809 9552009-03-31 Joseph Myers <joseph@codesourcery.com>
956
957 PR preprocessor/15638
958 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
959 invalid PCH.
960 (open_file_failed): Make error for missing file fatal.
961 * include/cpplib.h (CPP_DL_FATAL): Define.
962
bfba65a4 9632009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
964
965 PR preprocessor/31932:
966 * internal.h: Don't mention HAVE_ICONV_H.
967 * configure, config.in: Rebuild.
968 * configure.ac: Don't check for iconv.h.
969
102a7306 9702009-03-30 Tom Tromey <tromey@redhat.com>
971
972 PR preprocessor/39512:
973 * line-map.c (linemap_init): Initialize 'reallocator' field.
974
4514949a 9752009-03-30 Jakub Jelinek <jakub@redhat.com>
976
977 PR target/39558
978 * macro.c (cpp_get_token): If macro_to_expand returns NULL
979 and used some tokens, add CPP_PADDING before next token.
980
7f5f3953 9812009-03-29 Joseph Myers <joseph@codesourcery.com>
982
983 PR preprocessor/34695
984 * makedepend.c: Remove.
985 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
986 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
987 * directives.c (cpp_errors): Remove.
988 * errors.c (print_location, _cpp_begin_message, v_message):
989 Remove.
990 (cpp_error, cpp_error_with_line): Always use error callback.
991 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
992 * include/cpplib.h (cpp_options): Remove pedantic_errors,
993 inhibit_warnings, warn_system_headers, inhibit_errors,
994 warnings_are_errors, client_diagnostic.
995 (cpp_callbacks): Add extra arguments to error callback; make it
996 return bool.
997 (cpp_finish): Return void.
998 (cpp_destroy): Remove inaccurate comment about return value.
999 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
1000 (CPP_DL_NOTE): Define.
1001 * include/line-map.h (linemap_print_containing_files): Remove.
1002 * init.c (cpp_finish): Do not check for or return number of
1003 errors.
1004 * internal.h (cpp_reader): Remove errors field.
1005 * line-map.c (linemap_print_containing_files): Remove.
1006 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
1007 about previous definition. Only emit it if previous diagnostic
1008 was emitted.
1009
d5a78dd0 10102009-03-28 Joseph Myers <joseph@codesourcery.com>
1011
1012 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
1013 mkinstalldirs.
1014
0ac758f7 10152009-03-18 Jakub Jelinek <jakub@redhat.com>
1016
1017 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
1018
7811eab5 10192009-02-21 Joseph Myers <joseph@codesourcery.com>
1020
1021 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
1022 header name.
1023 (_cpp_lex_direct): Handle this.
1024
b5c49426 10252009-02-15 Richard Guenther <rguenther@suse.de>
1026
1027 Revert last change.
1028
76549266 10292009-02-13 Richard Guenther <rguenther@suse.de>
1030
1031 * configure.ac: Enable LFS.
1032 * configure: Re-generate.
1033 * config.in: Likewise.
1034
e7ae053d 10352009-01-05 Ben Elliston <bje@au.ibm.com>
1036
1037 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
1038 (.po.pox): Likewise.
1039 (po/$(PACKAGE).pot): Likewise.
1040
c1203b1c 10412008-12-10 Alexandre Oliva <aoliva@redhat.com>
1042
1043 PR target/37033
1044 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
1045 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
1046
cd740bd5 10472008-11-29 Joseph Myers <joseph@codesourcery.com>
1048
1049 * lex.c (cpp_token_len): Use 6 as default length.
1050
ae5c166d 10512008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
1052
1053 * expr.c (struct op): Add location.
1054 (_cpp_parse_expr): Propagate locations throught the stack
1055 of expressions.
1056 (reduce): Likewise.
1057 (check_promotion): Use explicit location in errors.
1058
956c6108 10592008-10-05 Matthew Gingell <gingell@adacore.com>
1060 Arnaud Charlet <charlet@adacore.com>
1061
1062 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
1063 (cpp_get_comments): New function.
1064 * internal.h (struct cpp_reader): Add comments field.
1065 * init.c (cpp_destroy): Free comments.
1066 * lex.c (store_comment, cpp_get_comments): New functions.
1067 (comments): New struct.
1068 (save_comment): Store comments in comments struct.
1069
2ad0b097 10702008-09-18 Simon Baldwin <simonb@google.com>
1071
1072 * include/cpplib.h (struct cpp_options): Add new boolean flag
1073 warn_builtin_macro_redefined.
1074 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
1075 * (struct builtin_operator): Split out from previous struct builtin,
1076 enhance extra const correctness.
1077 * (struct builtin_macro): Split out from previous struct builtin, add
1078 new always_warn_if_redefined flag, enhance const correctness.
1079 * (mark_named_operators): Use struct builtin_operator.
1080 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
1081 to builtins selectively.
1082 * macro.c (warn_of_redefinition): Return false if a builtin macro
1083 is not flagged with NODE_WARN.
1084
408c2285 10852008-07-31 Jakub Jelinek <jakub@redhat.com>
1086
1087 PR preprocessor/36649
1088 * files.c (struct report_missing_guard_data): New type.
1089 (report_missing_guard): Put paths into an array instead of printing
1090 them right away. Return 1 rather than 0.
1091 (report_missing_guard_cmp): New function.
1092 (_cpp_report_missing_guards): Sort and print paths gathered by
1093 report_missing_guard callback.
1094
98e29890 10952008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1096
1097 PR 28079
1098 * directives.c (strtolinenum): Handle overflow.
1099 (do_line): Give a warning if line number overflowed.
1100 (do_linemarker): Update call to strtolinenum.
1101
4999c35b 11022008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1103
1104 * include/line-map.h (linenum_type): New typedef.
1105 (struct line_map): Use it.
1106 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
1107 (SOURCE_COLUMN): Likewise.
1108 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
1109 source_location values in a variable of type linenum_type.
1110 * directives.c (struct if_stack): Use linenum_type.
1111 (strtoul_for_line): Rename as strtolinenum.
1112 (do_line): Use linenum_type.
1113 (do_linemarker): Use linenum_type and strtolinenum.
1114 (_cpp_do_file_change): Use linenum_t.
1115 * line-map.c (linemap_add): Likewise.
1116 (linemap_line_start): Likewise.
1117 * traditional.c (struct fun_macro): 'line' is a source_location.
1118 * errors.c (print_location): Use linenum_type.
1119 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
1120 * internal.h (CPP_INCREMENT_LINE): Likewise.
1121 * lex.c (_cpp_skip_block_comment): Use source_location.
1122
89768577 11232008-07-14 Ben Elliston <bje@au.ibm.com>
1124
1125 * include/cpplib.h (NODE_CONDITIONAL): New.
1126 (struct cpp_callbacks): New macro_to_expand field.
1127 (struct cpp_hashnode): Adjust size of flags and type fields.
1128 (cpp_peek_token): Prototype.
1129 * lex.c (cpp_peek_token): New function.
1130 (_cpp_temp_token): Protect pre-existing lookaheads.
1131 * macro.c (cpp_get_token): Expand any conditional macros.
1132 (_cpp_backup_tokens_direct): New.
1133 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
1134 (warn_of_redefinition): Silently allow redefined conditional
1135 macros.
1136 (_cpp_create_definition): Remove the conditional flag when a user
1137 defines one of the conditional macros.
1138 * internal.h (_cpp_backup_tokens_direct): New prototype.
1139
403c2b12 11402008-06-13 Andrew Haley <aph@redhat.com>
1141
1142 PR preprocessor/33305
1143 * macro.c (replace_args): Print a warning for empty macro
1144 arguments in C89 and C++.
1145
5b2c7553 11462008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1147
1148 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
1149 * configure: Regenerate.
1150
b9de6413 11512008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1152
1153 * Makefile.in (datarootdir): New variable.
1154
bfa57d81 11552008-06-12 H.J. Lu <hongjiu.lu@intel.com>
1156
1157 PR preprocessor/36479
1158 * charset.c (cpp_interpret_string_notranslate): Also set
1159 narrow_cset_desc.width.
1160
6af9f7ea 11612008-06-07 Joseph Myers <joseph@codesourcery.com>
1162
1163 * configure.ac (parisc*64*-*-*): Remove.
1164 * configure: Regenerate.
1165
536a48ee 11662008-05-30 Tom Tromey <tromey@redhat.com>
1167
1168 PR preprocessor/36320:
1169 * internal.h (_cpp_parse_expr): Update.
1170 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
1171 messages.
1172 * directives.c (do_if): Update.
1173 (do_elif): Require expression if processing group.
1174
f4d02485 11752008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
1176
1177 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
1178
c0770282 11792008-05-21 Tom Tromey <tromey@redhat.com>
1180
1181 PR preprocessor/27777:
1182 * lex.c (cpp_output_line_to_string): New function.
1183 * internal.h (_cpp_begin_message): Don't declare.
1184 * errors.c (_cpp_begin_message): Now static.
1185 * include/cpplib.h (cpp_output_line_to_string): Declare.
1186 * directives.c (do_diagnostic): Rewrote. Use
1187 cpp_output_line_to_string. Don't use _cpp_begin_message.
1188
dfecde36 11892008-05-21 Tom Tromey <tromey@redhat.com>
1190
1191 * include/symtab.h (HT_ALLOCED): Remove.
1192 (ht_purge): Declare.
1193 * symtab.c (DELETED): New define.
1194 (ht_lookup): Update comment.
1195 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
1196 code. Use subobject allocator for strings, if it exists.
1197 (ht_expand): Handle deleted entries.
1198 (ht_forall): Likewise.
1199 (ht_purge): New function.
1200 (ht_dump_statistics): Print deletion statistics.
1201
fb9753dc 12022008-05-13 Tom Tromey <tromey@redhat.com>
1203
1204 PR preprocessor/22168:
1205 * include/cpplib.h (struct cpp_options) <objc>: Update
1206 documentation.
1207 * expr.c (eval_token): Warn for use of assertions.
1208 * directives.c (directive_diagnostics): Warn about extensions.
1209 (DEPRECATED): New define.
1210 (DIRECTIVE_TABLE): Use it.
1211
151e90cc 12122008-05-06 Tom Tromey <tromey@redhat.com>
1213
1214 PR preprocessor/35313, PR preprocessor/36088:
1215 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
1216 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
1217
2cd62354 12182008-05-04 David S. Miller <davem@davemloft.net>
1219
1220 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
1221 * configure: Regenerate.
1222
85e51d59 12232008-04-22 Daniel Franke <franke.daniel@gmail.com>
1224
1225 * include/cpplib.h (cpp_define_formatted): New.
1226 * directives.c (cpp_define_formatted): New.
1227
d656d07a 12282008-04-21 Tom Tromey <tromey@redhat.com>
1229
1230 PR libcpp/33415:
1231 * charset.c (_cpp_convert_input): Add buffer_start argument.
1232 Ignore UTF-8 BOM if seen.
1233 * internal.h (_cpp_convert_input): Add argument.
1234 * files.c (struct _cpp_file) <buffer_start>: New field.
1235 (destroy_cpp_file): Free buffer_start, not buffer.
1236 (_cpp_pop_file_buffer): Likewise.
1237 (read_file_guts): Update.
1238
924bbf02 12392008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1240
1241 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
1242 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
1243 (struct cpp_options): Added uliterals.
1244 (cpp_interpret_string): Update prototype.
1245 (cpp_interpret_string_notranslate): Idem.
1246 * charset.c (init_iconv_desc): New width member in cset_converter.
1247 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
1248 (convert_ucn): Idem.
1249 (emit_numeric_escape): Idem.
1250 (convert_hex): Idem.
1251 (convert_oct): Idem.
1252 (convert_escape): Idem.
1253 (converter_for_type): New function.
1254 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
1255 (cpp_interpret_string_notranslate): Match changed prototype.
1256 (wide_str_to_charconst): Use converter_for_type.
1257 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
1258 * directives.c (linemarker_dir): Macro U changed to UC.
1259 (parse_include): Idem.
1260 (register_pragma_1): Idem.
1261 (restore_registered_pragmas): Idem.
1262 (get__Pragma_string): Support CPP_STRING{16,32}.
1263 * expr.c (eval_token): Support CPP_CHAR{16,32}.
1264 * init.c (struct lang_flags): Added uliterals.
1265 (lang_defaults): Idem.
1266 * internal.h (struct cset_converter) <width>: New field.
1267 (struct cpp_reader) <char16_cset_desc>: Idem.
1268 (struct cpp_reader) <char32_cset_desc>: Idem.
1269 * lex.c (digraph_spellings): Macro U changed to UC.
1270 (OP, TK): Idem.
1271 (lex_string): Add support for u'...', U'...', u"..." and U"...".
1272 (_cpp_lex_direct): Idem.
1273 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
1274 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
1275
6a88da51 12762008-04-18 Paolo Bonzini <bonzini@gnu.org>
1277
1278 PR bootstrap/35457
1279 * aclocal.m4: Regenerate.
1280 * configure: Regenerate.
1281
6e6d82ef 12822008-04-17 Tom Tromey <tromey@redhat.com>
1283
1284 PR libcpp/34866:
1285 * errors.c (cpp_error): Don't reference a token before the start
1286 of the current run.
1287
f521616b 12882008-04-16 Tom Tromey <tromey@redhat.com>
1289
1290 * Makefile.in (TAGS_SOURCES): New variable.
1291 (TAGS): New target.
1292
fc7383ad 12932008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
1294
1295 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
1296 and shbe-*-*.
1297 * configure: Rebuilt.
1298
34c3de48 12992008-04-02 Joseph Myers <joseph@codesourcery.com>
1300
1301 * include/cpplib.h (struct cpp_callbacks): Add used_define,
1302 used_undef and before_define.
1303 (NODE_USED): Define.
1304 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
1305 do_ifndef, cpp_pop_definition): Handle new flag and use new
1306 callbacks.
1307 * expr.c (parse_defined): Handle new flag and use new callbacks.
1308 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
1309 flag and use new callbacks.
1310
f2225b1a 13112008-04-01 Jakub Jelinek <jakub@redhat.com>
1312
1313 PR pch/13675
1314 * files.c (struct _cpp_file): Remove pch field.
1315 (pch_open_file): Don't set file->pch, just file->pchname.
1316 (should_stack_file): After pfile->cb.read_pch call
1317 free pchname and clear pchname, don't close file->fd.
1318 Test file->pchname instead of file->pch. Don't close fd after cb.
1319 (_cpp_stack_include): Test file->pchname instead of file->pch.
1320
5a959782 13212008-03-28 Tom Tromey <tromey@redhat.com>
1322
1323 * Makefile.in (POSTCOMPILE): New variable.
1324 (.c.o): Use it.
1325
8302ff7f 13262008-03-13 Tom Tromey <tromey@redhat.com>
1327
1328 PR libcpp/35322:
1329 * directives.c (destringize_and_run): Set pfile->directive.
1330
8bd452d9 13312008-03-06 Markus Milleder <markus.milleder@generali.at>
1332
1333 PR preprocessor/35458
1334 * mkdeps.c (munge): Quote '#' with a '\'.
1335
0c62b06e 13362008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1337
1338 PR preprocessor/35379
1339 * mkdeps.c (deps_write): Ensure the first target always appears
1340 in the first column, without leading backslash newline. Avoid
1341 some more extra whitespace.
1342
6b0c1373 13432008-02-25 Thiemo Seufer <ths@mips.com>
1344
0c62b06e 1345 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
6b0c1373 1346
e297899b 13472008-02-19 Tom Tromey <tromey@redhat.com>
1348
1349 * traditional.c (lex_identifier): Use CPP_HASHNODE.
1350 * lex.c (lex_identifier): Use CPP_HASHNODE.
1351 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
1352 do-while.
1353 * identifiers.c (alloc_node): Change return type.
1354 (_cpp_init_hashtable): Don't cast 'alloc_node'.
1355 (proxy_assertion_broken): New declaration.
1356 (cpp_forall_identifiers): Move comment.
1357 * line-map.c (linemap_add): Comment fix.
1358 (linemap_line_start): Indentation fix.
1359
45f9f140 13602008-01-25 Jakub Jelinek <jakub@redhat.com>
1361
1362 PR preprocessor/34692
1363 * macro.c (collect_args): Add pragma_buff argument. Push
1364 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
1365 than into arguments. Reset prevent_expansion and parsing_args
1366 state at CPP_PRAGMA_EOL/CPP_EOF.
1367 (funlike_invocation_p): Add pragma_buff argument, pass it through
1368 to collect_args.
1369 (enter_macro_context): Add result argument. Adjust
1370 funlike_invocation_p caller. Emit all deferred pragma tokens
1371 gathered during collect_args before the expansion, add a padding
1372 token. Return 2 instead of 1 if any pragma tokens were prepended.
1373 (cpp_get_token): If enter_macro_context returns 2, don't return
1374 a padding token, instead cycle to grab CPP_PRAGMA token.
1375 * directives.c (_cpp_handle_directive): If was_parsing_args
1376 in deferred pragma, leave parsing_args and prevent_expansion as is.
1377
a56d0856 13782008-01-22 Tom Tromey <tromey@redhat.com>
1379
45f9f140 1380 PR c++/34859
a56d0856 1381 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
1382 __STDC_CONSTANT_MACROS.
1383
7a1a608c 13842008-01-07 Fred Fish <fnf@specifix.com>
1385
45f9f140 1386 PR preprocessor/30363
7a1a608c 1387 * traditional.c (replace_args_and_push): Add local variable
1388 cxtquote, calculate the replacement text size assuming a
1389 worst case of every input character quoted with backslash,
1390 and properly handle output quoting of quote characters in
1391 actual arguments used in function-like macros.
1392
cde59b72 13932008-01-03 Tom Tromey <tromey@redhat.com>
1394
45f9f140 1395 PR preprocessor/34602
cde59b72 1396 * directives.c (do_line): Don't try to spell EOF token.
1397 (do_linemarker): Add comment.
1398
2d1f9589 13992007-12-11 DJ Delorie <dj@redhat.com>
1400
1401 * charset.c (convert_using_iconv): Close out any shift states,
1402 returning to the initial state.
1403
64cb8c90 14042007-12-06 Tom Tromey <tromey@redhat.com>
1405
45f9f140 1406 PR c/29172
64cb8c90 1407 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
1408 type.
1409 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
1410 * files.c (FILE_HASH_POOL_SIZE): New macro.
1411 (struct file_hash_entry_pool): New.
1412 (destroy_all_cpp_files): New function.
1413 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
1414 (new_file_hash_entry): Update.
1415 (free_file_hash_entries): New function.
1416 (_cpp_cleanup_files): Call free_file_hash_entries and
1417 destroy_all_cpp_files.
1418 (cpp_clear_file_cache): New function.
1419 * include/cpplib.h (cpp_clear_file_cache): Declare.
1420
d08a0ab3 14212007-12-03 Tom Tromey <tromey@redhat.com>
1422
45f9f140 1423 PR preprocessor/34288
d08a0ab3 1424 * configure.ac, config.in: Rebuilt.
1425 * configure.ac: Check for ssize_t.
1426
5eb3761c 14272007-11-30 Tom Tromey <tromey@redhat.com>
1428
45f9f140 1429 PR preprocessor/32868
5eb3761c 1430 * macro.c (_cpp_create_definition): Special case
1431 __STDC_FORMAT_MACROS.
1432
bce619a6 14332007-11-16 Michael Matz <matz@suse.de>
1434
1435 * files.c (search_path_head): Fix check for absolute paths.
1436
67015c73 14372007-11-11 Tom Tromey <tromey@redhat.com>
1438
45f9f140 1439 PR c++/17557
67015c73 1440 * include/cpplib.h (cpp_included_before): Declare.
1441 * files.c (struct file_hash_entry) <location>: New field.
1442 (_cpp_find_file): Initialize new field.
1443 (make_cpp_dir): Likewise.
1444 (cpp_included_before): New function.
1445
1991d8eb 14462007-11-01 Tom Tromey <tromey@redhat.com>
1447
45f9f140 1448 PR preprocessor/30805
1991d8eb 1449 * macro.c (paste_tokens): Handle padding token.
1450 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
1451
2d507e67 14522007-10-31 Tom Tromey <tromey@redhat.com>
1453
45f9f140 1454 PR preprocessor/30786
2d507e67 1455 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
1456 * directives.c (_cpp_do__Pragma): Return error status.
1457 * internal.h (_cpp_do__Pragma): Update.
1458 * directives.c (get__Pragma_string): Back up if EOF seen.
1459
931b0a0f 14602007-09-06 Tom Tromey <tromey@redhat.com>
1461
1462 * internal.h (struct cpp_reader) <invocation_location>: New
1463 field.
1464 (struct cpp_reader) <set_invocation_location>: Likewise.
1465 * init.c (cpp_set_line_map): New function.
1466 * line-map.c (linemap_add): Use linemap's allocator.
1467 * include/line-map.h (GTY): Define.
1468 (line_map_realloc): New typedef.
1469 (struct line_map): Mark with GTY.
1470 (struct line_maps): Likewise.
1471 (struct line_maps) <maps>: Likewise.
1472 (struct line_maps) <reallocator>: New field.
1473 * include/symtab.h (GTY): Conditionally define.
1474 * include/cpplib.h (cpp_set_line_map): Declare.
1475 (cpp_get_token_with_location): Declare.
1476 * macro.c (cpp_get_token): Set invocation_location on the reader.
1477 (cpp_get_token_with_location): New function.
1478
84373723 14792007-08-30 Chao-ying Fu <fu@mips.com>
1480
1481 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
1482 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
1483 (cpp_classify_number): Support decimal fixed-point constants without
1484 exponents.
1485 Warn about fixed-point constants when -pedantic.
1486 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
1487 comments to support fixed-point values.
1488 (CPP_N_FRACT, CPP_N_ACCUM): Define.
1489
36ec4203 14902007-08-18 Tom Tromey <tromey@redhat.com>
1491
45f9f140 1492 PR preprocessor/32974
36ec4203 1493 * directives.c (parse_include): Don't check for EOL when
1494 processing #pragma dependency.
1495
fcde64dc 14962007-07-30 Ollie Wild <aaw@google.com>
1497
1498 * directives-only.c: New file.
1499 * internal.h (struct _cpp_dir_only_callbacks): New.
1500 (_cpp_preprocess_dir_only): New function.
1501 * directives.c (_cpp_handle_directive): Check directives_only before
1502 disabling execution of indented directives.
1503 * files.c (_cpp_stack_file): Add directives_only check.
1504 * include/cpplib.h (struct cpp_options): Add directives_only.
1505 (cpp_init_special_builtins): New function.
1506 * init.c (cpp_init_special_builtins): New function.
1507 (cpp_init_builtins): Move builtin_array initialization to
1508 cpp_init_special_builtins.
1509 (post_options): Check directives_only before setting
1510 pfile->state.prevent_expansion = 1.
1511 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
1512 is expanded inside a directive while -fdirectives-only is enabled.
1513 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
1514 (libcpp_a_SOURCES): Add directives-only.c.
1515
ddedd1e1 15162007-07-04 Uros Bizjak <ubizjak@gmail.com>
1517
1518 * traditional.c (_cpp_scan_out_logical_line): Initialize
1519 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
1520 fmacro.args to prevent 'may be used uninitialized' warning.
1521
430be8e2 15222007-07-03 Uros Bizjak <ubizjak@gmail.com>
1523
1524 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
1525 Add new constants.
1526 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
1527 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
1528 for 'q' or 'Q' suffixes.
1529
909dc303 15302007-06-17 Danny Smith <dannysmith@users.sourceforge.net
1531
857d7d5e 1532 * files.c (open_file): Correct typo.
909dc303 1533
7d6f49d6 15342007-06-16 Vladimir Prus <vladimir@codesourcery.com>
1535
857d7d5e 1536 * files.c (open_file): Prevent the call
7d6f49d6 1537 for stat from overwriting errno.
1538
be21d64c 15392007-06-09 Vladimir Prus <vladimir@codesourcery.com>
1540
857d7d5e 1541 * files.c (open_file): Account for the
be21d64c 1542 fact that on windows, opening a directory gives
1543 EACCES.
1544
d7282a2b 15452007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
1546
1547 PR preprocessor/23479
1548 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
1549 integer constants.
1550 (append_digit): Likewise.
1551 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
1552 binary integer constants.
1553
0448520c 15542007-05-31 Dave Korn <dave.korn@artimi.com>
1555
1556 PR preprocessor/14331
1557 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
1558
ce079f70 15592007-05-24 Ollie Wild <aaw@google.com>
1560
1561 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
1562 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
1563 (cpp_write_pch_state): Save __COUNTER__ state.
1564 (cpp_valid_state): Check valid __COUNTER__ state.
1565 (cpp_read_state): Read new __COUNTER__ state.
1566 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
1567 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
1568 * internal.h (struct cpp_reader): Add counter member.
1569
3b6c638e 15702007-05-23 Simon Martin <simartin@users.sourceforge.net>
1571
1572 PR preprocessor/20077
1573 * macro.c (create_iso_definition): Fixed the method to determine
1574 whether the token-pasting operator appears at the beginning or the end
1575 of a macro.
1576
248dfc42 15772007-05-21 Ian Lance Taylor <iant@google.com>
1578
1579 * internal.h (struct cpp_reader): Add new fields:
1580 nonexistent_file_hash and nonexistent_file_ob.
1581 * files.c: Include "obstack.h".
1582 (find_file_in_dir): Before trying to open the file, look up the
1583 path name in the hash table of nonexistent files. After failing
1584 to open the file, add the path name to the hash table.
1585 (_cpp_find_file): Cache the results of looking up the file name
1586 starting with the quote and bracket chain heads, if we can.
1587 (nonexistent_file_hash_eq): New static function.
1588 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
1589 pfile->nonexistent_file_ob.
1590 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
1591 pfile->nonexistent_file_ob.
1592
c55e2f1b 15932007-05-14 Janis Johnson <janis187@us.ibm.com>
1594
5c00409a 1595 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
1596
c55e2f1b 1597 PR c/31924
1598 * expr.c (interpret_float_suffix): Check for invalid suffix.
1599
dd97b5e4 16002007-05-02 Eric Christopher <echristo@apple.com>
1601
1602 * expr.c (num_div_op): Don't overflow if the result is
1603 zero.
1604
3127c357 16052007-05-02 Tom Tromey <tromey@redhat.com>
1606
45f9f140 1607 PR preprocessor/28709
3127c357 1608 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
1609
f23c2abe 16102007-03-30 Michael Meissner <michael.meissner@amd.com>
1611
1612 * directives.c (lex_macro_node_from_str): Fix alloca call to be
1613 type correct.
1614
3fa3949d 16152007-03-30 Richard Henderson <rth@redhat.com>
1616
1617 * directives.c (lex_macro_node_from_str): New.
1618 (cpp_push_definition, cpp_pop_definition): New.
1619 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
1620
7262ccd6 16212007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1622
1623 * Makefile.in: Add dummy install-pdf target.
1624
09edb0e9 16252007-01-30 Tom Tromey <tromey@redhat.com>
1626
45f9f140 1627 PR preprocessor/30468
09edb0e9 1628 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
1629 './'.
1630
e0ff7935 16312007-01-30 Tom Tromey <tromey@redhat.com>
1632
45f9f140 1633 PR preprocessor/29966
e0ff7935 1634 * macro.c (lex_expansion_token): Save and restore cpp_reader's
1635 cur_token.
1636 (_cpp_create_definition): Don't restore cur_token here.
1637 * lex.c (_cpp_lex_token): Added assertion.
1638
87d210c3 16392007-01-27 Tom Tromey <tromey@redhat.com>
1640
1641 * configure: Rebuilt.
1642
3e2a04b5 16432007-01-12 Tom Tromey <tromey@redhat.com>
1644
45f9f140 1645 PR preprocessor/28227
3e2a04b5 1646 * directives.c (lex_macro_node): Added 'is_def_or_undef'
1647 argument.
1648 (do_define): Update.
1649 (do_undef): Update.
1650 (do_ifdef): Update.
1651 (do_ifndef): Update.
1652
6a6e7e2f 16532007-01-11 Paolo Bonzini <bonzini@gnu.org>
1654
1655 * configure: Regenerate.
1656
77258a2e 16572007-01-11 Paolo Bonzini <bonzini@gnu.org>
1658
1659 * configure: Regenerate.
1660
927b511f 16612007-01-04 Tom Tromey <tromey@redhat.com>
1662
45f9f140 1663 PR preprocessor/28165
927b511f 1664 * internal.h (cpp_in_primary_file): New function.
1665 * directives.c (do_include_next): Use cpp_in_primary_file.
1666 (do_pragma_once): Likewise.
1667 (do_pragma_system_header): Likewise.
1668
5008f5c5 16692006-12-29 Ian Lance Taylor <iant@google.com>
1670
1671 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
1672 look backward at the end of the line unless we saw a backslash.
1673
5d70627e 16742006-12-29 Jakub Jelinek <jakub@redhat.com>
1675
1676 PR preprocessor/29612
1677 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
1678 only when new_sysp is non-zero.
1679
854f075e 16802006-12-28 Tom Tromey <tromey@redhat.com>
1681
45f9f140 1682 PR preprocessor/30001
854f075e 1683 * charset.c (_cpp_convert_input): Check that to.len is greater
1684 than zero.
1685
644459d0 16862006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
1687
1688 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
db375b8e 1689 * configure: Rebuilt.
644459d0 1690
093aec7c 16912006-11-01 Douglas Gregor <doug.gregor@gmail.com>
1692
1693 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
1694 for experimental C++0x mode.
1695 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
1696 adopted the preprocessor changes introduced in C99.
1697
54bb64fb 16982006-10-29 Joseph Myers <joseph@codesourcery.com>
1699
1700 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
1701 depending on --enable-targets=all.
1702 * configure: Regenerate.
1703
46139d3f 17042006-10-12 Jakub Jelinek <jakub@redhat.com>
1705
1706 PR preprocessor/28709
1707 * macro.c (paste_tokens): Do error reporting here, use BUF with the
1708 spelled LHS token as opposed to spelling it again.
1709 (paste_all_tokens): Don't report errors here, just break on failure.
1710
51f93521 17112006-10-10 Brooks Moses <bmoses@stanford.edu>
1712
1713 * Makefile.in: Added empty "pdf" target.
1714
32bca58b 17152006-09-22 Geoffrey Keating <geoffk@apple.com>
1716
1717 * configure.ac: Make need_64_bit_hwint case for x86-darwin
1718 match exactly the glob in gcc/config.gcc.
1719 * configure: Regenerate.
1720
0b67f687 17212006-09-13 Joseph S. Myers <joseph@codesourcery.com>
1722
1723 PR c/28768
1724 PR preprocessor/14634
1725 * lex.c (lex_string): Pedwarn for unterminated literals.
1726
3ebc7dec 17272006-09-08 Eric Christopher <echristo@apple.com>
1728
1729 * configure.ac: Add 64-bit HWI support for i?86-darwin.
1730
e58c07f7 17312006-08-14 Steve Ellcey <sje@cup.hp.com>
1732
1733 PR c++/28288
1734 PR c++/14556
1735 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
1736 (CPP_LAST_EQ): Change.
1737 (CPP_LAST_PUNCTUATOR): Change.
1738 * expr.c (cpp_operator): Remove MIN and MAX.
1739 (reduce): Remove CPP_MIN and CPP_MAX.
1740 (num_binary_op): Ditto.
1741 * lex.c (_cpp_lex_direct): Ditto.
1742 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
1743
add258d7 17442006-06-09 Jakub Jelinek <jakub@redhat.com>
1745
1746 PR preprocessor/27746
1747 * directives.c (do_pragma): Handle pragma with valid namespace
1748 and invalid name coming from macro expansion.
1749 * directives.c (destringize_and_run): Initialize next field in
1750 context.
1751
1752 PR c/27747
1753 PR c++/27748
1754 * directives.c (destringize_and_run): Set NO_EXPAND on the
1755 tokens.
1756
1757 * macro.c (_cpp_backup_tokens): Fix comment typo.
1758
49688a56 17592006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
1760
1761 * Makefile.in (CATALOGS): Add po/ prefix.
1762 * configure: Regenerated.
1763
8f597c12 17642006-05-23 Carlos O'Donell <carlos@codesourcery.com>
1765
1766 * Makefile.in: Add install-html target. Add install-html to .PHONY
1767
cca5dddc 17682006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
1769
1770 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
1771 * files.c (_cpp_get_file_stat): New function.
1772 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
1773 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
1774 * internal.h (_cpp_get_file_stat): Prototype.
1775 (struct cpp_buffer): Add timestamp.
1776
31614f7c 17772006-01-23 Jakub Jelinek <jakub@redhat.com>
1778
1779 PR preprocessor/25717
1780 * init.c (cpp_init_builtins): If __STDC__ will not change value
1781 between system headers and other sources, define it as a normal
1782 macro rather than a builtin.
1783 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
1784 cpp_in_system_header condition.
1785
17862006-01-05 Paolo Bonzini <bonzini@gnu.org>
3c77e017 1787
1788 * Makefile.in: Use -MMD instead of -MD.
1789
b75b98aa 17902006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
1791 Richard Henderson <rth@redhat.com>
1792
1793 Merge from gomp branch:
1794 * directives.c (struct pragma_entry): Add is_deferred. Add ident
1795 entry to value union.
1796 (end_directive): Don't eat the line if in_deferred_pragma.
1797 (run_directive): Remove pragma hacks.
1798 (insert_pragma_entry): Remove.
1799 (new_pragma_entry): New.
1800 (register_pragma_1): Split out of register_pragma. Only handle
1801 the lookup tree and return the new entry.
1802 (cpp_register_pragma): Fill in the pragma entry here.
1803 (cpp_register_deferred_pragma): New.
1804 (register_pragma_internal): New.
1805 (_cpp_init_internal_pragmas): Use register_pragma_internal.
1806 (do_pragma): Allow pragma expansion after namespace. For deferred
1807 pragmas, don't slurp the line into a string.
1808 (destringize_and_run): Save tokens for deferred pragmas.
1809 (cpp_handle_deferred_pragma): Remove.
1810 * macro.c (builtin_macro): Remove pragma token hack.
1811 (_cpp_push_token_context): Rename from push_token_context and export.
1812 * internal.h (struct lexer_state): Add pragma_allow_expansion.
1813 (_cpp_push_token_context): Declare.
1814 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
1815 a token. Update the line number correctly if so.
1816 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
1817 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
1818 * include/cpplib.h (PRAGMA_EOL): New.
1819 (CPP_TOKEN_FLD_PRAGMA): New.
1820 (struct cpp_token): Add val.pragma.
1821 (struct cpp_options): Remove defer_pragmas.
1822 (cpp_handle_deferred_pragma): Remove.
1823 (cpp_register_deferred_pragma): Declare.
1824
986ca356 18252006-01-01 Jakub Jelinek <jakub@redhat.com>
1826
1827 PR c++/25294
1828 * directives.c (do_pragma): If pragma line ends with multi-line
1829 block comment, end the saved deferred pragma string before that
1830 comment. Handle embedded '\0' chars on the pragma line.
1831
8dba02f7 18322005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
1833
1834 PR c++/23333
1835 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
1836
6db045b0 18372005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
1838 Ben Elliston <bje@au.ibm.com>
1839
1840 * include/cpplib.h (CPP_N_DFLOAT): New.
1841 * expr.c (interpret_float_suffix): Identify df, dd, and dl
1842 suffixes as decimal floating point constants.
1843 (cpp_classify_number): Disallow hexadecimal DFP constants.
1844
9a7c76f9 18452005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
b75b98aa 1846 Ian Lance Taylor <ian@airs.com>
9a7c76f9 1847
1848 * include/cpplib.h (struct cpp_callbacks): Annotate error with
1849 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
1850
0c5e3a3d 18512005-11-09 Per Bothner <per@bothner.com>
1852 Uros Bizjak <uros@kss-loka.si>
3ebc7dec 1853
0c5e3a3d 1854 PR c/24101
1855 * init.c (read_original_filename): Temporarily set
1856 state.in_directive before calling _cpp_lex_direct for
1857 CPP_HASH tokens.
1858
3c2359db 18592005-11-03 James E Wilson <wilson@specifix.com>
1860
1861 PR preprocessor/24202
1862 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
1863
d65b3a40 18642005-11-04 Joseph S. Myers <joseph@codesourcery.com>
1865
1866 * include/cpplib.h (struct cpp_callbacks): Make error take
1867 va_list* parameter.
1868 * errors.c (cpp_error): Update call to callback.
1869
cc9012f7 18702005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
1871
1872 PR preprocessor/22042
1873 * macro.c (_cpp_builtin_macro_text): Lower the needed max
1874 buffer size.
1875 (cpp_quote_string): Don't octalify non printable
1876 charactors.
1877
eb0d20b7 18782005-11-03 Joseph S. Myers <joseph@codesourcery.com>
1879
1880 PR c++/17964
1881 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
1882 (struct cpp_callbacks): Add error.
1883 * errors.c (cpp_error): If client_diagnostic, use error callback.
1884 * charset.c (convert_escape): Don't use %03o in diagnostic.
1885
de4aacc0 18862005-10-21 James E Wilson <wilson@specifix.com>
04c0bfd0 1887
1888 PR preprocessor/15220
1889 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
1890 callers. Pass to open_file_failed.
1891 (open_file_failed): New parameter angle_brackets. Fix all callers.
1892 Use in print_dep assignment.
1893 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
1894 * internal.h (_cpp_find_file): Add new parm to declaration.
3ebc7dec 1895
6783d878 18962005-10-08 Kazu Hirata <kazu@codesourcery.com>
1897
1898 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
1899 * configure: Regenerate.
1900
f789fe3e 19012005-10-04 Ian Lance Taylor <ian@airs.com>
1902
1903 PR preprocessor/13726
1904 * directives.c (check_eol_return_comments): New static function.
1905 (parse_include): Add buf parameter. Change all callers.
1906 (do_include_common): If not discard comments, turn on
1907 save_comments. Pass collected comments to include callback.
1908 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
1909 include callback: cpp_token list.
1910
865c4e44 19112005-09-20 Joseph S. Myers <joseph@codesourcery.com>
1912
1913 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
1914 * init.c (struct lang_flags, lang_defaults): Add
1915 extended_identifiers.
1916 (cpp_set_lang): Use it.
1917 * lex.c (forms_identifier_p): Check extended_identifiers.
1918
56845aa6 19192005-08-30 Jakub Jelinek <jakub@redhat.com>
1920
1921 PR preprocessor/20348
1922 PR preprocessor/20356
1923 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
1924 2004-06-05 changes.
1925
72ee8ff9 19262005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
1927
1928 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
1929 -Wmissing-format-attribute.
1930
1931 * configure: Regenerate.
1932
2656917a 19332005-06-29 Kelley Cook <kcook@gcc.gnu.org>
1934
1935 * all files: Update FSF address in copyright headers.
1936 * makeucnid.c (write_copyright): Update outputted FSF address.
1937
cbaa9876 19382005-06-13 Zack Weinberg <zack@codesourcery.com>
1939
1940 * configure.ac: Invoke ZW_CREATE_DEPDIR and
1941 ZW_PROG_COMPILER_DEPENDENCIES.
1942 * aclocal.m4, configure: Regenerate.
1943 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
1944 New variables.
1945 (distclean): Clean up $(DEPDIR) and its contents.
1946 (.c.o): Use $(COMPILE).
1947 Include $(DEPDIR)/*.Po for most object->header dependencies.
1948
720aca92 19492005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
1950
1951 * configure.ac: Check declarations for asprintf and vasprintf.
1952 * config.in: Regenerate.
1953 * configure: Likewise.
1954
1955 * charset.c (conversion_loop): Use XRESIZEVEC.
1956 (convert_no_conversion): Likewise.
1957 (convert_using_iconv): Likewise.
1958 (init_iconv_desc): Cast return value of alloca.
1959 (cpp_host_to_exec_charset): Use XNEWVEC.
1960 (emit_numeric_escape): Use XRESIZEVEC.
1961 (cpp_interpret_string): Use XNEWVEC.
1962 (cpp_interpret_string): Use XRESIZEVEC.
1963 (_cpp_interpret_identifier): Cast return value of alloca.
1964 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
1965 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
1966 (parse_include): Use XNEWVEC.
1967 (insert_pragma_entry): Rename local variable "new" to
cbaa9876 1968 "new_entry".
720aca92 1969 (save_registered_pragmas): Cast return value of xmemdup.
1970 (destringize_and_run): Same for alloca.
1971 (parse_assertion): Likewise.
1972 (do_assert): Cast allocated storage to proper type.
1973 (cpp_define): Likewise.
1974 (_cpp_define_builtin): Likewise.
1975 (cpp_undef): Likewise.
1976 (handle_assertion): Likewise.
1977 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
1978 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
1979 (CPP_UMINUS): Likewise.
1980 (struct cpp_operator): Rename from struct operator.
1981 (_cpp_expand_op_stack): Use XRESIZEVEC.
1982 * files.c (pch_open_file): Use XNEWVEC.
1983 (pch_open_file): Use XRESIZEVEC.
1984 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
1985 (dir_name_of_file): Use XNEWVEC.
1986 (make_cpp_file): Use XCNEW.
1987 (make_cpp_dir): Likewise.
1988 (allocate_file_hash_entries): USE XNEWVEC.
1989 (cpp_included): Cast return value of htab_find_with_hash.
1990 (append_file_to_dir): Use XNEWVEC.
1991 (read_filename_string): Likewise. Use XRESIZEVEC too.
1992 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
1993 (remap_filename): Use XNEWVEC.
1994 (struct pchf_entry): Move definition out of struct pchf_data.
1995 (_cpp_save_file_entries): Use XCNEWVAR.
1996 (_cpp_read_file_entries): Use XNEWVAR.
1997 * identifiers.c (alloc_node): Use XOBNEW.
1998 * init.c (cpp_create_reader): Use XCNEW.
1999 (cpp_init_builtins): Cast of b->value to enum builtin_type.
2000 (read_original_directory): Cast return value of alloca.
2001 * lex.c (add_line_note): Use XRESIZEVEC.
2002 (warn_about_normalization): Use XNEWVEC.
2003 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
2004 (new_buff): Use XNEWVEC.
2005 * line-map.c (linemap_add): Use XRESIZEVEC.
2006 * macro.c (builtin_macro): Cast return value of alloca.
2007 (paste_tokens): Likewise.
2008 (expand_arg): Use XNEWVEC and XRESIZEVEC.
2009 (_cpp_save_parameter): Use XRESIZEVEC.
2010 (create_iso_definition): Cast allocated storage to proper type.
2011 (_cpp_create_definition): Likewise.
2012 (cpp_macro_definition): Use XRESIZEVEC.
2013 * makedepend.c (add_clm): Use XNEW.
2014 (add_dir): Likewise.
2015 * mkdeps.c (munge): Use XNEWVEC.
2016 (deps_init): Use XCNEW.
2017 (deps_add_target): Use XRESIZEVEC.
2018 (deps_add_default_target): Cast return value of alloca.
2019 (deps_add_dep): Use XRESIZEVEC.
2020 (deps_add_vpath): Likewise. Use XNEWVEC too.
2021 (deps_restore): Likewise.
2022 * pch.c (save_idents): Use XNEW and XNEWVEC.
2023 (cpp_save_state): Use XNEW.
2024 (count_defs): Cast return value of htab_find.
2025 (write_defs): Likewise.
2026 (cpp_write_pch_deps): Use XNEWVEC.
2027 (collect_ht_nodes): Use XRESIZEVEC.
2028 (cpp_valid_state): Use XNEWVEC.
2029 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
2030 * symtab.c (ht_create): Use XCNEW.
2031 (ht_lookup_with_hash): Cast return value of obstack_copy0.
2032 (ht_expand): Use XCNEWVEC.
2033 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
2034 (bool): Do not define if __cplusplus.
2035
81e19b31 20362005-05-12 Zack Weinberg <zack@codesourcery.com>
2037
2038 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
2039 (do_sccs): Delete function definition, #define to do_ident.
2040 (do_ident): Don't hardwire directive name.
2041
18f11b84 20422005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
2043
2044 PR bootstrap/21230
2045 * configure: Regenerate.
2046
2dc04f36 20472005-04-27 Andris Pavenis <pavenis@latnet.lv>
2048
2049 * files.c: Include io.h for DJGPP to get prototype of setmode.
2050
0b7f838f 20512005-04-19 Per Bothner <per@bothner.com>
2052
2053 PR preprocessor/20907
2054 * line-map.c (linemap_line_start): Fix bug when we need to increse
2055 column_bits but can re-use the current line_map.
2056
2224c90b 20572005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2058
2059 * system.h (fopen, fdopen, freopen): Define these to the unlocked
2060 libiberty functions.
2061
077a3c99 20622005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2063
2064 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
2065 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
2066 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
2067 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
2068 _unlocked function.
2069 (fwrite_unlocked): Fix prototype.
81e19b31 2070
077a3c99 2071 * configure, config.in: Regenerate.
2072
99617355 20732005-04-05 Jakub Jelinek <jakub@redhat.com>
2074
2075 PR preprocessor/19475
2076 * macro.c (create_iso_definition): For < ISO C99, don't
2077 pedwarn if there is no whitespace between macro name and its
2078 replacement, but the replacement starts with a basic character
2079 set character.
2080
3827dee5 20812005-03-28 Andreas Jaeger <aj@suse.de>
2082
2083 * lex.c (warn_about_normalization): Cast field width to int to
2084 avoid warning.
2085
b8273627 20862005-03-19 Joseph S. Myers <joseph@codesourcery.com>
2087
2088 * configure.ac: Consistently use solaris2.1[0-9]* instead of
2089 solaris2.1[0-9].
2090 * configure: Regenerate.
2091
bc65f24f 20922005-03-15 Geoffrey Keating <geoffk@apple.com>
2093
2094 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
2095 UCN rather than printing an error.
2096
bce47149 20972005-03-14 Geoffrey Keating <geoffk@apple.com>
2098
4e9d1e6d 2099 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
2100
21012005-03-14 Geoffrey Keating <geoffk@apple.com>
81e19b31 2102
bce47149 2103 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
2104 * charset.c: Update for new format of ucnid.h.
2105 (ucn_valid_in_identifier): Update for new format of ucnid.h.
2106 Add NST parameter, and update it; update callers.
2107 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
2108 with cpp_error.
2109 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
2110 * internal.h (struct normalize_state): New.
2111 (INITIAL_NORMALIZE_STATE): New.
2112 (NORMALIZE_STATE_RESULT): New.
2113 (NORMALIZE_STATE_UPDATE_IDNUM): New.
2114 (_cpp_valid_ucn): New.
2115 * lex.c (warn_about_normalization): New.
2116 (forms_identifier_p): Add normalize_state parameter, update callers.
2117 (lex_identifier): Add normalize_state parameter, update callers. Keep
2118 the state current.
2119 (lex_number): Likewise.
2120 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
2121 it with warn_about_normalization.
2122 * makeucnid.c: New.
2123 * ucnid.h: Replace.
2124 * ucnid.pl: Remove.
2125 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
2126 comments about obsolete version of C++.
2127 * include/cpplib.h (enum cpp_normalize_level): New.
2128 (struct cpp_options): Add warn_normalize field.
2129
bb1fa6bb 21302005-03-11 Geoffrey Keating <geoffk@apple.com>
2131
2132 * directives.c (glue_header_name): Update call to cpp_spell_token.
2133 * internal.h (_cpp_interpret_identifier): New.
2134 * charset.c (_cpp_interpret_identifier): New.
2135 (_cpp_valid_ucn): Allow UCN version of '$'.
2136 * lex.c (lex_identifier): Add extra parameter to indicate if initial
2137 character was '$' or '\'. Support identifiers with UCNs.
2138 (forms_identifier_p): Allow UCNs.
2139 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
2140 (utf8_to_ucn): New.
2141 (cpp_spell_token): Add FORSTRING parameter. Use it.
2142 (cpp_token_as_text): Update call to cpp_spell_token.
2143 (cpp_output_token): Write UCNs back out.
2144 (stringify_arg): Update call to cpp_spell_token.
2145 (paste_tokens): Likewise.
2146 (cpp_macro_definition): Likewise.
2147 * macro.c (stringify_arg): Likewise.
2148 (paste_tokens): Likewise.
2149 (cpp_macro_definition): Likewise.
2150 * include/cpplib.h: Add parameter to cpp_spell_token.
2151
960391da 21522005-03-04 Jakub Jelinek <jakub@redhat.com>
2153
2154 PR bootstrap/20282
2155 PR bootstrap/20305
2156 * macro.c (replace_args, cpp_get_token): Copy whole
2157 cpp_token_u instead of just cpp_string field from it.
2158
b0d0794d 21592005-02-28 Devang Patel <dpatel@apple.com>
2160
2161 * directives.c (do_line): Save sysp early before line table is
2162 realloc'ed.
81e19b31 2163
624d37a6 21642005-02-20 Zack Weinberg <zack@codesourcery.com>
2165
2166 PR 18785
2167 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
2168 (cpp_host_to_exec_charset): New function.
2169 * include/cpplib.h: Declare cpp_host_to_exec_charset.
2170
f86986bc 21712005-02-19 Devang Patel <dpatel@apple.com>
2172
2173 * charset.c (_cpp_convert_input): Check '\r' before inserting
2174 '\n' at the end.
624d37a6 2175
9936e07d 21762005-02-15 Eric Christopher <echristo@redhat.com>
2177
2178 PR preprocessor/19077
2179 * macro.c (cpp_macro_definition): Move handling of whitespace
2180 to PREV_WHITE conditional. Remove overloading of len
2181 variable.
2182
129a1540 21832005-02-14 Kazu Hirata <kazu@cs.umass.edu>
2184
2185 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
2186 traditional.c: Update copyright.
2187
bb30d1f4 21882005-02-14 Paolo Bonzini <bonzini@gnu.org>
2189
2190 PR bootstrap/19818
2191 * configure.ac: Check for declaration of basename and getopt.
2192 * config.in: Regenerate.
2193 * configure: Regenerate.
2194 * internal.h (ustrcspn): New.
2195 * macro.c (create_iso_definition): Fix allocation of memory.
2196 (padding_token): Add cast to remove const-ness.
2197 * pch.c (cpp_read_state): Use ustrcspn.
2198
26ec4f15 21992005-02-08 Mike Stump <mrs@apple.com>
2200
2201 * files.c (pchf_adder): Remove.
2202 (struct pchf_adder_info): Likewise.
2203 (_cpp_save_file_entries): Write out all files so that #import works.
2204
0cb78cbd 22052005-01-23 Joseph S. Myers <joseph@codesourcery.com>
2206
2207 * configure: Regenerate.
2208
d862067c 22092005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
2210
2211 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
2212
457e71e4 2213 * include/cpplib.h: Also update copyright years.
624d37a6 2214
ba841ef8 22152005-01-03 Geoffrey Keating <geoffk@apple.com>
2216
2217 * files.c (_cpp_find_file): Add files found by search_path_exhausted
2218 to the list of all files.
2219
f03668bd 22202005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
2221
2222 * internal.h: Update references to Cpp lib filenames.
2223 * directives.c: Likewise.
2224 * init.c: Likewise.
2225 * macro.c: Likewise.
2226 * traditional.c: Likewise.
2227
461ea98d 22282004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
2229
2230 PR preprocessor/15167
2231 * files.c (destroy_cpp_file): New function.
2232 (should_stack_file): Make a new file if the
2233 compared file is still stacked.
2234
bd9e37a6 22352004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
2236
624d37a6 2237 PR preprocessor/17610
bd9e37a6 2238 * directives.c (do_include_common): Error out if an empty filename
2239 is given for #include (or #include_next or #import).
2240
fe4dcd90 22412004-11-27 Roger Sayle <roger@eyesopen.com>
2242 Zack Weinberg <zack@codesourcery.com>
2243
2244 * internal.h: Replace all uses of uchar with unsigned char.
2245 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
2246 with !IN_GCC, so uchar is only defined whilst building libcpp.
2247
ac7cc2f4 22482004-11-24 Kelley Cook <kcook@gcc.gnu.org>
2249
2250 * aclocal.m4: Regenerate.
2251
6e11b263 22522004-11-24 Roger Sayle <roger@eyesopen.com>
2253
2254 PR preprocessor/15824
2255 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
2256 directly, instead of the non-existant "system.h" and "ansidecl.h".
2257 * configure: Regenerate.
2258
68bf2ad9 22592004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 2260 Joseph Myers <joseph@codesourcery.com>
68bf2ad9 2261
2262 * internal.h (struct lexer_state): Add in_deferred_pragma.
2263 * directives.c (struct pragma_entry): Add allow_expansion.
2264 (insert_pragma_entry): Take allow_expansion flag.
2265 (register_pragma): Likewise.
2266 (cpp_register_pragma): Likewise.
2267 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
2268 (do_pragma): Honor allow_expansion.
2269 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
2270 * include/cpplib.h (cpp_register_pragma): Update prototype.
2271
27559c4e 22722004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 2273 Mark Mitchell <mark@codesourcery.com>
27559c4e 2274
2275 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
2276 need_64bit_hwint=yes.
2277 * configure: Regenerate.
2278
34ae664d 22792004-11-09 Joseph S. Myers <joseph@codesourcery.com>
2280
2281 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
2282 po/$(PACKAGE).pot.
2283 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
2284 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
2285 Remove local srcdir path from generated file.
2286
39b83bdb 22872004-11-04 Zack Weinberg <zack@codesourcery.com>
624d37a6 2288 Gerald Pfeifer <gerald@pfeifer.com>
39b83bdb 2289
2290 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
2291 as well.
2292
a095c1b5 22932004-10-27 Zack Weinberg <zack@codesourcery.com>
2294
2295 PR 18075
2296 * directives.c (do_pragma): Do not defer pragmas which are unknown.
2297 (cpp_handle_deferred_pragma): Add cast to silence warning.
2298
700b0d81 22992004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
2300
2301 * errors.c (_cpp_begin_message): Print "error: " for errors.
2302
fbe83ac1 23032004-10-10 Andreas Jaeger <aj@suse.de>
2304
2305 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
2306 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
2307
09f10c94 23082004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
2309
2310 * pch.c (cpp_write_pch_state): Remove variable z as it is not
2311 used.
2312 (cpp_read_state): Remove unused variables, m, d and mac_count.
2313
a8b2a8d5 23142004-09-29 Per Bothner <per@bothner.com>
2315
2316 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
2317 cb.line_change. Otherwise do_pragma will call the line_change
2318 call-back with a meaningless line number.
2319
21164c01 23202004-09-24 Zack Weinberg <zack@codesourcery.com>
2321
2322 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
2323 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
2324 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
2325 * aclocal.m4, configure: Regenerate.
2326 * init.c: Include localedir.h.
2327 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
2328 (DEFS): Delete.
2329 (.c.o): Use $(ALL_CFLAGS).
2330 (localedir.h, localedir.hs): New rules.
2331 (clean): Use rm -rf to remove directories.
2332 (distclean): Also delete localedir.h and localedir.hs.
2333 (init.o): Update dependencies.
2334
986086aa 23352004-09-22 Kelley Cook <kcook@gcc.gnu.org>
2336
2337 * Makefile.in (aclocal.m4): Update dependencies.
2338 * configure.ac (AC_CONFIG_MACRO_DIR): New.
2339 * aclocal.m4, configure: Regenerate.
2340
e9cc3617 23412004-09-17 Zack Weinberg <zack@codesourcery.com>
2342
0097f6a2 2343 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
2344 (_cpp_convert_input, _cpp_default_encoding): Add comments.
2345 Some other comments in this file also tweaked.
2346
e9cc3617 2347 * directives.c (do_pragma): Save current buffer position
2348 before lexing the pragma keywords; don't call
2349 _cpp_backup_tokens in the defer_pragmas case.
2350
9832c977 23512004-09-15 Per Bothner <per@bothner.com>
2352
2353 * include/line-map.h (line_map_start): Add parameter names so
2354 preceding comment makes sense.
2355 (linemap_add): Remove from comment mention of non-existing parameter.
2356
d6d3c909 23572004-09-09 Matt Austern <austern@apple.com>
2358 Zack Weinberg <zack@codesourcery.com>
2359
2360 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
2361 prefixes throughout. Add entry for PRAGMA. Remove
2362 unnecessary "= 0" from EQ.
2363 (enum cpp_ttype): Adjust OP and TK definitions to restore
2364 prefixes, via token-paste.
2365 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
2366 Change from #defines to additional cpp_ttype enumerators.
2367 (struct cpp_options): Add defer_pragmas.
2368 (cpp_handle_deferred_pragma): Prototype new interface.
2369
2370 * internal.h (struct cpp_reader): Add directive_result.
2371 * directives.c (struct pragma_entry): Add is_internal field;
2372 give boolean fields type bool.
2373 (start_directive): Initialize pfile->directive_result.type.
2374 (_cpp_do__Pragma): Likewise.
2375 (run_directive): Do not crash if pfile->buffer->prev is NULL.
2376 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
2377 from it.
2378 (register_pragma): New static function, bulk of former
2379 cpp_register_pragma here; add 'internal' argument, pass along
2380 to insert_pragma_entry.
2381 (cpp_register_pragma): Now a wrapper around register_pragma which
2382 always passes false for 'internal' argument.
2383 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
2384 true for 'internal'.
2385 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
2386 an internal pragma, save text till the end of the line as a CPP_PRAGMA
2387 token instead of executing the pragma.
2388 (cpp_handle_deferred_pragma): New interface.
2389 * lex.c (token_spellings): Adjust OP and TK definitions to
2390 match changes to cpplib.h.
2391 (_cpp_lex_token): Check for a directive-result token and
2392 return it if present.
2393 (cpp_token_val_index): Handle CPP_PRAGMA.
2394 * macro.c (cpp_builtin_macro_text): Correct comment.
2395 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
2396
735a9bc4 23972004-09-06 Serge Belyshev <belyshev@lubercy.com>
2398
2399 PR preprocessor/14699
2400 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
2401 from size_t to double.
2402
25696d3f 24032004-08-28 Andreas Schwab <schwab@suse.de>
2404 Andreas Jaeger <aj@suse.de>
2405
2406 * configure.ac: Set PACKAGE correctly.
2407 * configure: Regenerated.
2408
99439f5b 24092004-08-25 Paolo Bonzini <bonzini@gnu.org>
2410
2411 * Makefile.in: Add back top_builddir.
2412
a668be26 24132004-08-25 Paolo Bonzini <bonzini@gnu.org>
2414
2415 * configure.ac: Replace Automake macro invocations
2416 with manual Autoconf checks and substitutions.
2417 * configure: Regenerate.
2418 * aclocal.m4: Regenerate.
2419 * config.in: Regenerate.
2420 * Makefile.am: Removed.
2421 * Makefile.in: Heavy simplification and reorganization.
2422
30e9913f 24232004-08-09 Mark Mitchell <mark@codesourcery.com>
2424
2425 * configure.ac (arm*-*-eabi*): New target.
2426 (arm*-*-symbianelf*): Likewise.
2427 * configure: Regenerated.
2428
3b298764 24292004-07-24 Bernardo Innocenti <bernie@develer.com>
2430
2431 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
2432 * directives.c: Use XNEW-family macros from libiberty.
2433 * lex.c: Likewise.
2434 * macro.c: Likewise.
2435 * cpplib.h (cpp_deps_style): Export enum with name.
2436
d6d3c909 24372004-07-23 Matthias Klose <doko@debian.org>
3b298764 2438
d6d3c909 2439 * init.c (init_library): Use PACKAGE for the text domain.
1ed7d058 2440
821fa045 24412004-07-16 Andris Pavenis <pavenis@latnet.lv>
2442
2443 PR preprocessor/16366
2444 * internal.h (struct cpp_reader): New field dir_hash.
2445 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
2446 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
2447
d80efa72 24482004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
2449
2450 PR preprocessor/16192
2451 PR preprocessor/15913
2452 PR preprocessor/15572
2453 * expr.c (_cpp_parse_expr): Handle remaining cases where an
2454 expression is missing.
2455 * init.c (post_options): Traditional cpp doesn't do // comments.
2456
ed000086 24572004-06-30 Per Bothner <per@bothner.com>
2458
2459 * include/line-map.h (fileline): Remove old typedef.
2460 * internal.h (struct cpp_reader): Use source_location typedef instead.
2461
dcb9d064 24622004-06-26 Zack Weinberg <zack@codesourcery.com>
2463
2464 Partially revert patch of 2004-06-05.
2465 * files.c (search_cache): Remove pfile argument. Don't check
2466 for file that would be found by "" or <> search here...
2467 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
2468 Do not apply directory-of-current-file correction to files
2469 found by this check. Rearrange code slightly.
2470
d718b525 24712004-06-21 Geoffrey Keating <geoffk@apple.com>
2472
2473 * files.c (should_stack_file): Correct swapped parameters to call
2474 to cb.read_pch.
2475 * pch.c (cpp_valid_state): Handle -fpreprocessed.
2476
79b68529 24772004-06-15 Paolo Bonzini <bonzini@gnu.org>
2478
2479 * Makefile.in: Regenerate with automake 1.8.5.
2480 * aclocal.m4: Likewise.
2481 * configure: Regenerate.
2482
151899c5 24832004-06-11 Zack Weinberg <zack@codesourcery.com>
2484
2485 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
2486 * configure, config.in: Regenerate.
2487 * system.h: Unconditionally define bool as unsigned char,
2488 BOOL_BITFIELD as unsigned int.
2489 * .cvsignore: New file.
2490
c39ed964 24912004-06-09 Geoffrey Keating <geoffk@apple.com>
2492
2493 * traditional.c (push_replacement_text): Set macro->traditional.
2494 (save_replacement_text): Likewise.
2495 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
2496 (struct save_macro_item): Delete.
2497 (struct save_macro_data): Use a character array not the previous
2498 structured format.
2499 (save_macros): Save macro as text not as internal structures.
2500 (cpp_prepare_state): Update for changes to save_macro_data.
2501 (cpp_read_state): Don't read macros defined in PCH. Restore
c84ca916 2502 -D macros as text.
c39ed964 2503 * macro.c (create_iso_definition): Honour alloc_subobject.
2504 Clear traditional flag.
2505 (_cpp_create_definition): Honour alloc_subobject.
2506 * lex.c (cpp_token_val_index): New.
2507 * internal.h: Include cpp-id-data.h.
2508 (uchar): Move definition to cpp-id-data.h.
2509 (U): Likewise.
2510 (cpp_macro): Likewise.
2511 * directives.c (struct answer): Move to cpp-id-data.h.
2512 (do_assert): Honour alloc_subobject.
c84ca916 2513
2514 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
2515 * include/cpplib.h (struct cpp_string): Add GTY marker.
2516 (enum cpp_token_fld_kind): New.
2517 (struct cpp_token): Add GTY markers.
2518 (cpp_token_val_index): Prototype.
2519 (CPP_HASHNODE_VALUE_IDX): New.
2520 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
2521 * include/cpp-id-data.h: New file.
c39ed964 2522
dd6e5561 25232004-06-09 Paolo Bonzini <bonzini@gnu.org>
2524
2525 * Makefile.am (all-local): New.
2526 * Makefile.in: Regenerate.
2527
8af0c78d 25282004-06-06 Roger Sayle <roger@eyesopen.com>
2529
2530 * Makefile.am (LIBICONV): Declare.
2531 (makedepend_LDADD): Use LIBICONV.
2532 * Makefile.in: Regenerate.
2533
30302733 25342004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
2535
2536 * Makefile.am (LIBINTL): Declare
2537 (makedepend_LDADD): Use LIBINTL.
2538 * Makefile.in: Regenerate.
2539
3eb3f293 25402004-06-05 Zack Weinberg <zack@codesourcery.com>
2541
2542 * Makefile.am: Add makedepend.
2543 * Makefile.in, aclocal.m4: Regenerate.
2544 * charset.c: Insert a space to avoid a warning.
2545 * directives.c: Include mkdeps.h.
2546 (_cpp_handle_directive): Reenable macro expander if appropriate.
2547 (undefine_macros): Inline body of _cpp_free_definition for speed.
2548 Do not call undef callback or _cpp_warn_if_unused_macro.
2549 (cpp_get_deps): New interface.
2550 * files.c (search_cache): Add pfile argument. Check for file
2551 that would be found by "" or <> search here...
2552 (_cpp_find_file): ...not here. Correct recorded start_dir of
2553 files found by directory-of-current-file search that would be
2554 found by "" or <> search.
2555 * init.c (cpp_add_dependency_target): Delete.
2556 * internal.h (struct lexer_state): Add discarding_output flag.
2557 * lex.c (lex_identifier): Compute hash function while scanning.
2558 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
2559 directives.
2560 * makedepend.c: New file.
2561 * mkdeps.c (struct deps): Add vpath vector.
2562 (apply_vpath, deps_add_vpath): New function.
2563 (deps_free): Free vpath vector.
2564 (deps_add_dep, deps_add_target): Use apply_vpath.
2565 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
2566 (ht_lookup_with_hash): New function.
2567 * cpplib.h, mkdeps.h: Update prototypes.
2568 * symtab.h: Update prototypes.
2569 (HT_HASHSTEP, HT_FINISH): New macros.
2570
8ed01400 25712004-05-29 Geoffrey Keating <geoffk@apple.com>
2572
2573 * symtab.c (ht_create): Set entries_owned.
2574 (ht_destroy): Honour entries_owned.
2575 (ht_expand): Likewise.
2576 (ht_load): New.
c84ca916 2577 * include/symtab.h (struct ht): New field 'entries_owned'
2578 (ht_load): New prototype.
8ed01400 2579
347a3ab5 25802004-05-26 Paolo Bonzini <bonzini@gnu.org>
2581
2582 PR bootstrap/15651
2583 * configure.ac: Fix m4 quoting when picking
2584 the size of HOST_WIDE_INT.
2585 * configure: Regenerate.
2586
fc231f28 25872004-05-25 Paolo Bonzini <bonzini@gnu.org>
2588
2589 * Makefile.am: the correct directory for
2590 gettext include files is given by @INCINTL@.
2591 * Makefile.in: Regenerate.
2592
babfbd63 25932004-05-24 Paolo Bonzini <bonzini@gnu.org>
2594
2595 * system.h [!ENABLE_NLS]: dgettext takes two
2596 parameters.
2597
d856c8a6 25982004-05-23 Paolo Bonzini <bonzini@gnu.org>
2599
2600 Moved libcpp from the gcc subdirectory to the toplevel.
2601 * Makefile.am: New file.
2602 * Makefile.in: Regenerate.
2603 * configure.ac: New file.
2604 * configure: Regenerate.
2605 * config.in: Regenerate.
2606 * charset.c: Moved from gcc/cppcharset.c. Add note about
2607 brokenness of input charset detection. Adjust for change
2608 in name of cppucnid.h.
2609 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
2610 * expr.c: Moved from gcc/cppexp.c.
2611 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
2612 Remove #define of O_BINARY, it is in system.h.
2613 * identifiers.c: Moved from gcc/cpphash.c.
2614 * internal.h: Moved from gcc/cpphash.h. Change header
2615 guard name. All other files adjusted to match name change.
2616 * init.c: Moved from gcc/cppinit.c.
2617 (init_library) [ENABLE_NLS]: Call bindtextdomain.
2618 * lex.c: Moved from gcc/cpplex.c.
2619 * directives.c: Moved from gcc/cpplib.c.
2620 * macro.c: Moved from gcc/cppmacro.c.
2621 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
2622 * traditional.c: Moved from gcc/cpptrad.c.
2623 * ucnid.h: Moved from gcc/cppucnid.h. Change header
2624 guard name.
2625 * ucnid.pl: Moved from gcc/cppucnid.pl.
2626 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
2627 guard name.
2628 * symtab.c: Moved from gcc/hashtable.c.
2629 * line-map.c: Moved from gcc. Do not include intl.h.
2630 * mkdeps.c: Moved from gcc.
2631 * system.h: New file.
c84ca916 2632 * include/cpplib.h: Moved from gcc. Change header guard name.
2633 * include/line-map.h: Moved from gcc. Change header guard name.
2634 * include/mkdeps.h: Moved from gcc. Change header guard name.
2635 * include/symtab.h: Moved from gcc/hashtable.h. Change header
2636 guard name.