]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
d35d1c0f
UB
12011-06-19 Uros Bizjak <ubizjak@gmail.com>
2
3 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
4 __builtin_ia32_pcmpestri128 instead of asm.
5
d86d2119
DA
62012-06-04 Dimitrios Apostolou <jimis@gmx.net>
7
8 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
9 every macro. This improves performance by reducing the number of
10 reallocations when track-macro-expansion is on.
11
7ca643e1
DS
122012-06-04 Dodji Seketeli <dodji@redhat.com>
13
14 PR preprocessor/53463
15 * line-map.c (linemap_location_in_system_header_p): For built-in
16 macro tokens, check the first expansion point location that is not
17 for a token coming from a built-in macro.
18
7d9641cc
JM
192012-05-29 Joseph Myers <joseph@codesourcery.com>
20
21 * directives.c: Fix typos.
22 * include/line-map.h: Fix typos.
23 * line-map.c: Fix typos.
24 * macro.c: Fix typos.
25
53a103d3
DS
262012-05-25 Dodji Seketeli <dodji@redhat.com>
27
28 PR bootstrap/53459
29 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
30 a static assertion.
31
828a7f76
DS
322012-05-29 Dodji Seketeli <dodji@redhat.com>
33
34 PR preprocessor/53229
35 * internal.h (cpp_reader::set_invocation_location): Remove.
36 (cpp_reader::about_to_expand_macro_p): New member flag.
37 * directives.c (do_pragma): Remove Kludge as
38 pfile->set_invocation_location is no more.
39 * macro.c (cpp_get_token_1): Do away with the use of
40 cpp_reader::set_invocation_location. Just collect the macro
41 expansion point when we are about to expand the top-most macro.
42 Do not override cpp_reader::about_to_expand_macro_p.
43 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
44 properly handle locations of expansion points.
45 (cpp_get_token_with_location): Adjust, as
46 cpp_reader::set_invocation_location is no more.
47 (paste_tokens): Take a virtual location parameter for
48 the LHS of the pasting operator. Use it in diagnostics. Update
49 comments.
50 (paste_all_tokens): Tighten the assert. Propagate the location of
51 the expansion point when no virtual locations are available.
52 Pass the virtual location to paste_tokens.
53 (in_macro_expansion_p): New static function.
54 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
55 flag until we really start expanding the macro.
56
0b2c4be5
DS
572012-05-16 Dodji Seketeli <dodji@redhat.com>
58
59 PR preprocessor/7263
60 * include/cpplib.h (cpp_classify_number): Take a location
61 parameter.
62 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
63 macros that take a location parameter.
64 (cpp_classify_number): Take a (virtual) location parameter. Use
65 it for diagnostics. Adjust comments.
66 (eval_token): Take a location parameter. Pass it to
67 cpp_classify_number and to diagnostic routines.
68 (_cpp_parse_expr): Use virtual locations of tokens when parsing
69 expressions. Pass a virtual location to eval_token and to
70 diagnostic routines.
71
638d2065
TG
722012-05-10 Tristan Gingold <gingold@adacore.com>
73
74 * expr.c (interpret_float_suffix): Add a guard.
75
3ad64f53
DS
762012-05-02 Dodji Seketeli <dodji@redhat.com>
77
78 Properly initialize cpp_context in destringize_and_run
79 * directives.c (destringize_and_run): Properly initialize the new
80 context.
81 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
82 the initial base context, which has the same life time as the
83 current instance of cpp_file.
84
b193dfa8
MLI
852012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
86 Dodji Seketeli <dodji@seketeli.org>
87
3efc2959 88 PR c++/52974
b193dfa8
MLI
89 * libcpp/files.c (maybe_shorter_path): New.
90 (find_file_in_dir): Use it.
91
4e65a470
DS
922012-04-30 Dodji Seketeli <dodji@redhat.com>
93
51fce2d3
DS
94 Switch -ftrack-macro-expansion=2 on by default.
95 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
96 by default. Add comments.
97
c4ca1a09
DS
98 Strip "<built-in>" loc from displayed expansion context
99 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
100 in comment.
101 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
102 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
103 new function.
104
3600218c
DS
105 Fix expansion point loc for macro-like tokens
106 * macro.c (macro_of_context): New static function.
107 (_cpp_push_token_context, push_extended_tokens_context): If the
108 macro argument is NULL, it means we are continuing the expansion
109 of the current macro, if any. Update comments.
110 (_cpp_pop_context): Re-enable expansion of the macro only when we
111 are really out of the context of the current expansion.
112
0ff2b8a0
DS
113 Fix token pasting with -ftrack-macro-expansion
114 * macro.c (paste_all_tokens): Put the token resulting from pasting
115 into an extended token context with -ftrack-macro-location is in
116 effect.
117
4e65a470
DS
118 Fix cpp_sys_macro_p with -ftrack-macro-expansion
119 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
120
112448b4
DS
1212012-04-29 Dodji Seketeli <dodji@redhat.com>
122
123 * lex.c (lex_raw_string): Change C++ style comments into C style
124 comments.
125 (lex_string): Likewise.
126
7f5f5f98
OW
1272012-04-27 Ollie Wild <aaw@google.com>
128
129 * include/cpplib.h (struct cpp_options): Add new field,
130 warn_literal_suffix.
131 (CPP_W_LITERAL_SUFFIX): New enum.
132 * init.c (cpp_create_reader): Default initialization of
133 warn_literal_suffix.
134 * lex.c (lex_raw_string): Treat user-defined literals which don't
135 begin with '_' as separate tokens and produce a warning.
136 (lex_string): Ditto.
137
1d72e96f
MLI
1382012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
139
140 * line-map.c (linemap_resolve_location): Synchronize comments with
141 those in line-map.h.
142 * include/line-map.h (linemap_resolve_location): Fix spelling in
143 comment.
144
e75b54a2
RE
1452012-03-22 Richard Earnshaw <rearnsha@arm.com>
146
147 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
148
7888f266
RO
1492012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
150
151 * lex.c: Remove Solaris 8 reference.
152
dd552284
WL
1532012-02-14 Walter Lee <walt@tilera.com>
154
155 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
156 * configure: Regenerate.
157
2c5cbc31
RG
1582012-01-09 Richard Guenther <rguenther@suse.de>
159
160 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
161
b492b686
GF
1622012-01-09 Gary Funck <gary@intrepid.com>
163
164 PR preprocessor/33919
165 * files.c (_cpp_get_file_name): New. Implement file name
166 access function.
167 * internal.h (_cpp_get_file_name): New prototype.
168 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
169 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
170
75291c57
OH
1712012-01-03 Olivier Hainque <hainque@adacore.com>
172
173 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
174
48b0b196
JM
1752011-12-20 Joseph Myers <joseph@codesourcery.com>
176
177 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
178 (CLK_STDC1X): Change to CLK_STDC11.
179 * init.c (lang_defaults): Update comments.
180 (cpp_init_builtins): Update language tests. Use 201112L for C11
181 __STDC_VERSION__.
182
4a5e00ca
AS
1832011-12-20 Andreas Schwab <schwab@linux-m68k.org>
184
185 * configure: Regenerate.
186
095af58f
AS
1872011-12-19 Andreas Schwab <schwab@linux-m68k.org>
188
189 * configure: Regenerate.
190
b0c084b7
JJ
1912011-12-07 Jakub Jelinek <jakub@redhat.com>
192
193 PR bootstrap/50237
194 * internal.h (_cpp_init_lexer): New prototype.
195 * init.c (init_library): Call it.
196 * lex.c (init_vectorized_lexer): Remove constructor attribute,
197 add inline keyword.
198 (HAVE_init_vectorized_lexer): Define.
199 (_cpp_init_lexer): New function.
200
9b554be9
DS
2012011-12-03 Dodji Seketeli <dodji@redhat.com>
202
203 * macro.c (tokens_buff_remove_last_token)
204 (tokens_buff_put_token_to): Add an 'inline' function specifier to
205 the prototype.
206
8dcf72a8
DN
2072011-11-22 Diego Novillo <dnovillo@google.com>
208
209 * include/line-map.h (linemap_dump): Declare.
210 (line_table_dump): Declare.
211 * line-map.c (linemap_dump): New.
212 (line_table_dump): New.
213
7e74ce3f
ESR
2142011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
215
216 PR c++/50958
217 * expr.c (cpp_userdef_char_remove_type): Fix typo.
218
e9411247
MM
2192011-11-03 Michael Matz <matz@suse.de>
220
221 PR bootstrap/50857
222 * configure.ac: Check for -fno-exceptions -fno-rtti.
223 * configure: Regenerate.
224 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
225 (ALL_CXXFLAGS): Use it.
226
0c1dace3
PC
2272011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
228
229 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
230
25339f10
JM
2312011-11-02 Jason Merrill <jason@redhat.com>
232
233 PR c++/50810
234 * configure.ac: Add -Wno-narrowing to warning options.
235
97e3ad20
JM
2362011-10-31 Jason Merrill <jason@redhat.com>
237
1fb80b0c
JM
238 PR libstdc++/1773
239 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
240
97e3ad20
JM
241 PR c++/50920
242 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
243 CLK_GNUCXX0X to CLK_GNUCXX11.
244
3ce4f9e4
ESR
2452011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
246
247 Implement C++11 user-defined literals.
248 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
249 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
250 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
251 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
252 (cpp_classify_number): Classify unrecognized tokens as user-defined
253 literals.
254 * include/cpplib.h: Add new tokens for user-defined literals.
255 * init.c: Add new preprocessor flag (cxx11).
256 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
257 including concatenation and promotion with suffixes.
258
3bb0c8db
DS
2592011-10-24 Dodji Seketeli <dodji@redhat.com>
260
261 * line-map.c (linemap_macro_map_lookup): Fix logic.
262
84756fd4
DS
2632011-10-24 Dodji Seketeli <dodji@redhat.com>
264
265 * include/line-map.h (linemap_expand_location): Take a line table
266 parameter. Update comment.
267 (linemap_resolve_location): Update comment.
268 (linemap_expand_location_full): Remove.
269 * line-map.c (linemap_resolve_location): Handle reserved
270 locations; return a NULL map in those cases.
271 (linemap_expand_location): If location is reserved, return a
272 zeroed expanded location. Update comment. Take a line table to
273 assert that the function takes non-virtual locations only.
274 (linemap_expand_location_full): remove.
275 (linemap_dump_location): Handle the fact that
276 linemap_resolve_location can return NULL line maps when the
277 location resolves to a reserved location.
278
279 * line-map.c (linemap_macro_map_lookup): Fix logic.
280
ad2305ad
DS
2812011-10-22 Dodji Seketeli <dodji@redhat.com>
282
283 PR bootstrap/50778
284 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
285 context to act upon.
286 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
287 comment.
288 (cpp_token_from_context_at): Likewise.
289 (cpp_peek_token): Use the context to peek tokens from.
290
cbbcf655
DS
2912011-10-20 Dodji Seketeli <dodji@redhat.com>
292
293 PR bootstrap/50801
294 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
295 number of tokens.
296
d17687f6
DS
2972011-10-18 Dodji Seketeli <dodji@redhat.com>
298
299 PR bootstrap/50760
300 * include/line-map.h (struct linemap_stats): Change the type of
301 the members from size_t to long.
302 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
303 iter->location_ptr.
304
411f92de
DS
3052011-10-17 Dodji Seketeli <dodji@redhat.com>
306
307 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
308 variable without using it if ENABLE_CHECKING is not defined. Mark
309 the LOCATION parameter as being unused.
310
b9bd6f74
TT
3112011-10-15 Tom Tromey <tromey@redhat.com>
312 Dodji Seketeli <dodji@redhat.com>
313
314 * include/line-map.h (struct line_maps::alloced_size_for_request):
315 New member.
316 * line-map.c (new_linemap): Use set->alloced_size_for_request to
317 get the actual allocated size of line maps.
318
64a1a422
TT
3192011-10-15 Tom Tromey <tromey@redhat.com>
320 Dodji Seketeli <dodji@redhat.com>
321
322 * line-map.h (struct linemap_stats): Declare new struct.
323 (linemap_get_statistics): Declare ...
324 * line-map.c (linemap_get_statistics): ... new function.
325 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
326 Declare new counters.
327 (enter_macro_context, replace_args): Update
328 num_macro_tokens_counter.
329 (cpp_get_token_1): Update num_expanded_macros_counter.
330
847e697a
TT
3312011-10-15 Tom Tromey <tromey@redhat.com>
332 Dodji Seketeli <dodji@redhat.com>
333
334 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
335 * include/line-map.h (linemap_dump_location): Declare ...
336 * line-map.c (linemap_dump_location): ... new function.
337
92582b75
TT
3382011-10-15 Tom Tromey <tromey@redhat.com>
339 Dodji Seketeli <dodji@redhat.com>
340
341 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
342 New option.
343 * internal.h (struct macro_context): New struct.
344 (enum context_tokens_kind): New enum.
345 (struct cpp_context)<tokens_kind>: New member of type enum
346 context_tokens_kind.
347 (struct cpp_context)<macro>: Remove this. Replace it with an enum
348 of macro and macro_context.
349 (struct cpp_context)<direct_p>: Remove.
350 (_cpp_remaining_tokens_num_in_context): Declare new function.
351 * directives.c (destringize_and_run): Adjust.
352 * lex.c (_cpp_remaining_tokens_num_in_context)
353 (_cpp_token_from_context_at): Define new functions
354 (cpp_peek_token): Use them.
355 * init.c (cpp_create_reader): Initialize the base context to zero.
356 (_cpp_token_from_context_at): Define new static function.
357 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
358 _cpp_token_from_context_at.
359 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
360 members.
361 (enum macro_arg_token_kind): New enum.
362 (struct macro_arg_token_iter): New struct.
363 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
364 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
365 (delete_macro_args, set_arg_token, get_arg_token_location)
366 (arg_token_ptr_at, macro_arg_token_iter_init)
367 (macro_arg_token_iter_get_token)
368 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
369 (expanded_token_index, tokens_buff_new, tokens_buff_count)
370 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
371 (tokens_buff_add_token, tokens_buff_remove_last_token)
372 (reached_end_of_context, consume_next_token_from_context): New
373 static functions.
374 (cpp_get_token_1): New static function. Split and extended from
375 cpp_get_token. Use reached_end_of_context and
376 consume_next_token_from_context. Unify its return point. Move
377 the location tweaking from cpp_get_token_with_location in here.
378 (cpp_get_token): Use cpp_get_token_1
379 (stringify_arg): Use the new arg_token_at.
380 (paste_all_tokens): Support tokens coming from extended tokens
381 contexts.
382 (collect_args): Return the number of collected arguments, by
383 parameter. Store virtual locations of tokens that constitute the
384 collected args.
385 (funlike_invocation_p): Return the number of collected arguments,
386 by parameter.
387 (enter_macro_context): Add a parameter for macro expansion point.
388 Pass it to replace_args and to the "used" cpp callback. Get the
389 number of function-like macro arguments from funlike_invocation_p,
390 pass it to the new delete_macro_args to free the memory used by
391 macro args. When -ftrack-macro-expansion is in effect, for macros
392 that have no arguments, create a macro map for the macro expansion
393 and use it to allocate proper virtual locations for tokens
394 resulting from the expansion. Push an extended tokens context
395 containing the tokens resulting from macro expansion and their
396 virtual locations.
397 (replace_args): Rename the different variables named 'count' into
398 variables with more meaningful names. Create a macro map;
399 allocate virtual locations of tokens resulting from this
400 expansion. Use macro_arg_token_iter to iterate over tokens of a
401 given macro. Handle the case of the argument of
402 -ftrack-macro-expansion being < 2. Don't free macro arguments
403 memory resulting from expand_arg here, as these are freed by the
404 caller of replace_arg using delete_macro_args now. Push extended
405 token context.
406 (next_context, push_ptoken_context, _cpp_push_token_context)
407 (_cpp_push_text_context): Properly initialize the context.
408 (expand_arg): Use the new alloc_expanded_arg_mem,
409 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
410 (_cpp_pop_context): Really free the memory held by the context.
411 Handle freeing memory used by extended tokens contexts.
412 (cpp_get_token_with_location): Use cpp_get_token_1.
413 (cpp_sys_macro_p): Adjust.
414 (_cpp_backup_tokens): Support the new kinds of token contexts.
415 * traditional.c (recursive_macro): Adjust.
416
46427374
TT
4172011-10-15 Tom Tromey <tromey@redhat>
418 Dodji Seketeli <dodji@redhat.com>
419
420 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
421 member.
422 (MAX_SOURCE_LOCATION): New constant.
423 (struct line_map_ordinary, struct line_map_macro): New structs.
424 (struct line_map): Turn this into a union of the two above. Add
425 comments.
426 (struct maps_info): New struct.
427 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
428 These now carry the map information that was previously scattered
429 in struct line_maps.
430 (struct map_info::allocated): Fix comment.
431 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
432 (ORDINARY_MAP_STARTING_LINE_NUMBER)
433 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
434 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
435 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
436 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
437 (MACRO_MAP_EXPANSION_POINT_LOCATION)
438 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
439 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
440 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
441 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
442 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
443 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
444 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
445 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
446 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
447 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
448 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
449 information.
450 (linemap_check_ordinary, linemap_assert)
451 (linemap_location_before_p): New macros.
452 (linemap_position_for_line_and_column)
453 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
454 (linemap_macro_expansion_map_p)
455 (linemap_macro_map_loc_to_def_point)
456 (linemap_macro_map_loc_unwind_once)
457 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
458 (linemap_get_source_line linemap_get_source_column)
459 (linemap_map_get_macro_name, linemap_get_file_path)
460 (linemap_location_in_system_header_p)
461 (linemap_location_from_macro_expansion_p): Declare new functions.
462 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
463 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
464 accessors act on ordinary maps only.
465 (INCLUDED_FROM): Return NULL for main files; use the new
466 accessors.
467 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
468 (struct expanded_location): Move here from gcc/input.h
469 (linemap_resolve_location, linemap_expand_location)
470 (linemap_expand_location_full): Declare new functions.
471 * line-map.c: Include cpplib.h, internal.h
472 (linemap_enter_macro, linemap_add_macro_token)
473 (linemap_get_expansion_line, linemap_get_expansion_filename): New
474 functions that are private to libcpp.
475 (linemap_assert): New macro.
476 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
477 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
478 (linemap_macro_map_loc_unwind_toward_spelling)
479 (linemap_macro_map_loc_to_exp_point)
480 (first_map_in_common_1, first_map_in_common): New static
481 functions.
482 (new_linemap): Define new static functions. Extracted and
483 enhanced from ...
484 (linemap_add): ... here. Use linemap_assert in lieu of abort
485 previously.
486 (linemap_tracks_macro_expansion_locs_p)
487 (linemap_add_macro_token, linemap_macro_expansion_map_p)
488 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
489 (linemap_macro_map_loc_to_def_point)
490 (linemap_macro_map_loc_unwind_once)
491 (linemap_step_out_once, linemap_map_get_index)
492 (linemap_get_source_line,linemap_get_source_column)
493 (linemap_get_file_path, linemap_map_get_macro_name)
494 (linemap_location_in_system_header_p)
495 (linemap_location_originated_from_system_header_p)
496 (linemap_location_from_macro_expansion_p)
497 (linemap_tracks_macro_expansion_locs_p)
498 (linemap_resolve_location, linemap_expand_location)
499 (linemap_expand_location_full)
500 (linemap_tracks_macro_expansion_locs_p)
501 (linemap_position_for_line_and_column, linemap_compare_locations):
502 Define new public functions.
503 (linemap_init): Initialize ordinary and macro maps information in
504 the map set.
505 (linemap_check_files_exited): Use the new accessors.
506 (linemap_free): Remove this dead code.
507 (linemap_line_start): Assert this uses an ordinary map. Adjust to
508 use the new ordinary map accessors and data structures. Don't
509 overflow past the lowest possible macro token's location.
510 (linemap_position_for_column): Assert the ordinary maps of the map
511 set are really ordinary. Use ordinary map accessors.
512 (linemap_lookup): Keep the same logic but generalize to allow
513 lookup of both ordinary and macro maps. Do not crash when called
514 with an empty line table.
515 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
516 new API of line-map.h.
517 * directives.c (start_directive, do_line, do_linemarker)
518 (do_linemarker): Likewise.
519 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
520 (make_cpp_dir, cpp_make_system_header): Likewise.
521 * init.c (cpp_read_main_file): Likewise.
522 * internal.h (CPP_INCREMENT_LINE): Likewise.
523 (linemap_enter_macro, linemap_add_macro_token)
524 (linemap_get_expansion_line, linemap_get_expansion_filename): New
525 functions private to libcpp.
526 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
527 (skip_line_comment, skip_whitespace, lex_raw_string)
528 (_cpp_lex_direct): Likewise.
529 * macro.c (_cpp_builtin_macro_text): Likewise.
530 (_cpp_aligned_alloc): Initialize the new name member of the macro.
531 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
532 Likewise.
533 * errors.c (cpp_diagnostic): Adjust to new linemap API.
534
892a371f
DS
5352011-08-28 Dodji Seketeli <dodji@redhat.com>
536
537 * line-map.c (linemap_add): Assert that reason must not be
538 LC_RENAME when called for the first time on a "main input file".
539
e3dfef44
GC
5402011-08-22 Gabriel Charette <gchare@google.com>
541
542 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
543 * internal.h (struct cpp_reader): Add field forced_token_location_p.
544 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
545 (cpp_force_token_locations): New.
546 (cpp_stop_forcing_token_locations): New.
547
32fe396e
RO
5482011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
549
550 PR libstdc++/1773
551 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
552
7c1ffff9
JM
5532011-08-18 Joseph Myers <joseph@codesourcery.com>
554
555 * include/cpplib.h (struct cpp_options): Fix typo.
556
a48e3dd1
JM
5572011-08-18 Joseph Myers <joseph@codesourcery.com>
558
559 * include/cpplib.h (struct cpp_options): Add rliterals.
560 * init.c (struct lang_flags, lang_defaults): Add rliterals.
561 (cpp_set_lang): Set rliterals option.
562 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
563 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
564
3f6ced10
GC
5652011-08-15 Gabriel Charette <gchare@google.com>
566
567 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
568 Update all users to use linemap_position_for_column instead.
569
0681d04c
GC
5702011-07-28 Gabriel Charette <gchare@google.com>
571
572 * include/line-map.h (struct line_maps):
573 Remove unused field last_listed. Update all users.
574
5e9627ca
L
5752011-07-28 H.J. Lu <hongjiu.lu@intel.com>
576
577 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
578 * configure: Regenerated.
579
a024b70f
RO
5802011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
581
582 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
583
5b6d595b
RO
5842011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
585 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
586
587 PR bootstrap/49794
588 * configure.ac: Test AM_ICONV with CXX.
589 * configure: Regenerate.
590 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
591
d0a9fbe1
DS
5922011-07-15 Dodji Seketeli <dodji@redhat.com>
593
594 * directives.c (struct if_stack): Use source_location as type
595 here.
596 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
597 indent, def_pragma, used_define, used_undef>: Properly use
598 source_location as parameter type, rather than unsigned int.
599
fbdd5d87
RO
6002011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
601
602 PR target/39150
603 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
604 like i[34567]86-*-solaris2.1[0-9]*.
605 * configure: Regenerate.
606
8787a05a
JM
6072011-06-16 Jason Merrill <jason@redhat.com>
608
609 PR c++/45399
610 * lex.c (lex_raw_string): Don't check for embedded NUL.
611
38fbfaf6
DS
6122011-06-06 Dodji Seketeli <dodji@redhat.com>
613
614 PR preprocessor/48532
615 * directives.c (do_pragma): Don't forget the invocation location
616 when parsing the pragma name of a namespaced pragma directive.
617
fc0993ac
JT
6182011-05-29 John Tytgat <John.Tytgat@aaug.net>
619
620 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
621
ef230b38
UB
6222011-05-22 Uros Bizjak <ubizjak@gmail.com>
623
624 PR target/49104
625 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
626 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
627
e5b0dad8
JK
6282011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
629
630 * system.h (ENUM_BITFIELD): Remove.
631
6cfae070
JJ
6322011-04-24 Jakub Jelinek <jakub@redhat.com>
633
634 PR preprocessor/48740
635 * lex.c (lex_raw_string): When raw string ends with
636 ??) followed by raw prefix and ", ensure it is preprocessed
637 with ??) rather than ??].
638
04695783
JM
6392011-04-20 Jim Meyering <meyering@redhat.com>
640
641 * files.c (destroy_cpp_file): Remove useless if-before-free.
642 * init.c (cpp_destroy): Likewise.
643 * macro.c (replace_args): Likewise.
644 * pch.c (cpp_valid_state): Likewise.
645
4489800d
KT
6462011-03-25 Kai Tietz <ktietz@redhat.com>
647
648 * files.c (file_hash_eq): Use filename_cmp
649 instead of strcmp.
650 (nonexistent_file_hash_eq): Likewise.
651 (remap_filename): Likewise.
652 Handle absolute DOS-path,
653 (append_file_to_dir): Check for IS_DIR_SEPARATOR
654 instead of slash.
655 (read_name_map): Likewise.
656 * linemap.c (linemap_add): Use filename_cmp
657 instead of strcmp.
658 * mkdeps.c (apply_vpath): Use filename_ncmp
659 instead of strncmp.
660 (deps_restore): Use filename_cmp instead of
661 strcmp.
662 * init.c (read_original_directory): Use
663 IS_DIR_SEPARATOR instead of checking for slash.
664
f3c33d9d
MM
6652011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
666
667 PR preprocessor/48192
668 * directives.c (do_ifdef): Do not consider conditional macros as
669 being defined.
670 (do_ifndef): Ditto.
671 * expr.c (parse_defined): Ditto.
672
01956319
RH
6732011-03-18 Richard Henderson <rth@redhat.com>
674
675 PR bootstrap/45381
676 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
677
c5a62c6f
EB
6782011-11-04 Eric Botcazou <ebotcazou@adacore.com>
679 Jakub Jelinek <jakub@redhat.com>
680
681 PR preprocessor/39213
682 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
683 pragmas as well in traditional mode.
684
0e1a989c
ILT
6852010-11-17 Ian Lance Taylor <iant@google.com>
686
687 PR bootstrap/45538
688 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
689 AC_LANG based on ENABLE_BUILD_WITH_CXX.
690
651a20b5
KT
6912010-11-16 Kai Tietz <kai.tietz@onevision.com>
692
693 PR preprocessor/17349
694 * lex.c (save_comment): Handle in argument passing c++
695 comments special.
696
480767a9
ILT
6972010-11-02 Ian Lance Taylor <iant@google.com>
698
699 * configure.ac: Use AC_SYS_LARGEFILE.
700 * configure: Rebuild.
701 * config.in: Rebuild.
702
078419c9 7032010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 704
078419c9
BS
705 * line-map.h (source_location): Remove obsolete comment
706 mentioning location_s.
707
d6874138
KT
7082010-09-29 Kai Tietz <kai.tietz@onevision.com>
709
710 PR preprocessor/45362
711 * directives.c (cpp_pop_definition): Make static.
712 (do_pragma_push_macro): Reworked to store text
713 definition.
714 (do_pragma_pop_macro): Add free text definition.
715 (cpp_push_definition): Removed.
716 * include/cpplib.h (cpp_push_definition): Removed.
717 (cpp_pop_definition): Likewise.
718 * internal.h (def_pragma_macro): Remove member 'value'
719 and add new members 'definition', 'line',
720 'syshdr', 'sued' and 'is_undef'.
721 * pch.c (_cpp_restore_pushed_macros): Rework to work
722 on text definition and store additional macro flags.
723 (_cpp_save_pushed_macros): Likewise.
724
e3339d0f
JM
7252010-09-29 Joseph Myers <joseph@codesourcery.com>
726
727 * include/cpplib.h (cpp_options): Rename warn_deprecated,
728 warn_traditional, warn_long_long and pedantic.
729 * directives.c (directive_diagnostics, _cpp_handle_directive):
730 Update names of cpp_options members.
731 * expr.c (cpp_classify_number, eval_token): Update names of
732 cpp_options members.
733 * init.c (cpp_create_reader, post_options): Update names of
734 cpp_options members.
735 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
736 cpp_options members.
737 * macro.c (parse_params): Update names of cpp_options members.
738
128465e6
ILT
7392010-09-15 Ian Lance Taylor <iant@google.com>
740
741 * init.c: Fix type name in comment.
742
a69d2520
JJ
7432010-08-31 Jakub Jelinek <jakub@redhat.com>
744
745 PR preprocessor/45457
746 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
747 needed.
748 * directives.c (do_ifdef, do_ifndef): Likewise.
749
707bcb7a
RO
7502010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
751
752 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
753
6f173e52
RH
7542010-08-24 Richard Henderson <rth@redhat.com>
755
756 PR bootstrap/45376
757 * configure.ac (HAVE_SSE4): New check.
758 * configure, config.in: Rebuild.
759 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
760
789d73cb
RO
7612010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
762
763 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
764 etc. on Solaris 2/x86.
765
246a2fcb
RH
7662010-08-21 Richard Henderson <rth@redhat.com>
767 Andi Kleen <ak@linux.intel.com>
768 David S. Miller <davem@davemloft.net>
769
770 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
771 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
772 (ptrdiff_t): Check via AC_CHECK_TYPE.
773 * config.in, configure: Rebuild.
774 * system.h: Include stdint.h, if available.
775 * lex.c (WORDS_BIGENDIAN): Provide default.
776 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
777 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
778 search_line_sse2, search_line_sse42, init_vectorized_lexer,
779 search_line_fast): New.
780 (_cpp_clean_line): Use search_line_fast. Restructure the fast
781 loop to make it clear when we're leaving the loop. Stay in the
782 fast loop for non-trigraph '?'.
783
8e680db5
JJ
7842010-06-11 Jakub Jelinek <jakub@redhat.com>
785
786 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
787 callback.
788 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
789 (cpp_macro_definition): Remove const qual from second argument.
790 * macro.c (enter_macro_context): Call user_builtin_macro callback for
791 NODE_BUILTIN !NODE_USED macros.
792 (warn_of_redefinition): Likewise. Remove const qual from second
793 argument.
794 (cpp_macro_definition): Likewise.
795 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
796 for NODE_BUILTIN !NODE_USED macros.
797
1cb42611
JM
7982010-06-10 Joseph Myers <joseph@codesourcery.com>
799
800 * include/cpplib.h (struct cpp_options): Remove show_column.
801 * init.c (cpp_create_reader, post_options): Don't set show_column.
802
ff5dfc48
JR
8032010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
804
805 PR bootstrap/44432
806 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
807 check that C++ compiler works.
808 * configure: Regenerate.
809
a9429e29
LB
8102010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
811
812 * include/symtab.h (ht_identifier_ptr): New.
813
c3f247f4
RW
8142010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
815 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
816
817 PR bootstrap/42798
818 * configure.ac: Check for declaration of 'basename(char *)'.
819 * configure: Regenerate.
820 * config.in: Regenerate.
821
2778d766
JM
8222010-04-25 Joseph Myers <joseph@codesourcery.com>
823
824 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
825 * init.c (lang_defaults): Add entries for new language variants.
826 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
827 variants.
828
d8a12e84
MLI
8292010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
830
831 PR cpp/43195
832 * files.c (report_missing_guard): Test for #pragma once.
833
87cf0651
SB
8342010-04-07 Simon Baldwin <simonb@google.com>
835
836 * directives.c (do_diagnostic): Add warning reason argument,
837 call appropriate error reporting function for code.
838 (directive_diagnostics): Call specific warning functions with
839 warning reason where appropriate.
840 (do_error, do_warning, do_pragma_dependency): Add warning reason
841 argument to do_diagnostic calls.
842 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
843 _cpp_create_definition): Call specific warning functions with
844 warning reason where appropriate.
845 * Makefile.in: Add new diagnostic functions to gettext translations.
846 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
847 to error callback.
848 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
849 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
850 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
851 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
852 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
853 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
854 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
855 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
856 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
857 warning reason codes.
858 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
859 cpp_warning_with_line, cpp_pedwarning_with_line,
860 cpp_warning_with_line_syshdr): New specific error reporting functions.
861 * pch.c (cpp_valid_state): Call specific warning functions with
862 warning reason where appropriate.
863 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
864 diagnostic handlers.
865 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
866 cpp_warning_with_line, cpp_pedwarning_with_line,
867 cpp_warning_with_line_syshdr): New specific error reporting functions.
868 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
869 specific warning functions with warning reason where appropriate.
870 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
871 warn_about_normalization, lex_identifier_intern, lex_identifier,
872 _cpp_lex_direct): Ditto.
873 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
874 narrow_str_to_charconst): Ditto.
875
d947ada0
JJ
8762010-04-06 Jakub Jelinek <jakub@redhat.com>
877
878 PR preprocessor/43642
879 * lex.c (lex_raw_string): Change type of TYPE variable to
880 unsigned char.
881
4d9e8446
RW
8822010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
883
884 * aclocal.m4: Regenerate.
885
52150625
JM
8862010-03-29 Jason Merrill <jason@redhat.com>
887
00a81b8b
JM
888 More N3077 raw string changes
889 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
890 strings.
891 * lex.c (bufring_append): Split out from...
892 (lex_raw_string): ...here. Undo trigraph and line splicing
893 transformations. Do process line notes in multi-line literals.
894 (_cpp_process_line_notes): Ignore notes that were already handled.
895
52150625
JM
896 Some raw string changes from N3077
897 * charset.c (cpp_interpret_string): Change inner delimiters to ().
898 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
899
709d7160
JJ
9002010-02-11 Jakub Jelinek <jakub@redhat.com>
901
902 * init.c (read_original_filename): Don't call read_original_directory
903 if _cpp_handle_directive returns 0.
904
dadab4fd
JM
9052010-01-01 Joseph Myers <joseph@codesourcery.com>
906
907 PR preprocessor/41947
908 * expr.c (cpp_classify_number): Give error for hexadecimal
909 floating-point constant with no digits before or after point.
910
3de8a540
AC
9112009-11-20 Arnaud Charlet <charlet@adacore.com>
912
913 * macro.c (enter_macro_context): Call cb.used callback if defined.
914 * directives.c (do_idef, do_ifndef): Ditto.
915 * include/cpplib.h (struct cpp_callbacks): Add used callback.
916
17e7cb85
KT
9172009-11-11 Kai Tietz <kai.tietz@onevision.com>
918
919 * directives.c (do_pragma_push_macro): New pragma handler.
920 (do_pragma_pop_macro): Likewise.
921 (_cpp_init_internal_pragmas): Add push_macro and
922 pop_macro handler to internal pragmas.
923 (lex_macro_node_from_str): Removed.
924 (cpp_push_definition): Replace lex_macro_node_from_str
925 by _cpp_lex_identifier.
926 (cpp_pop_definition): Likewise.
927 * internal.h (_cpp_lex_identifier): New prototype.
928 (def_pragma_macro): New structure.
929 (cpp_reader): New member pushed_macros.
930 * lex.c (_cpp_lex_identifier): New function.
931 (lex_identifier_intern): New function.
932 * init.c (cpp_create_reader): Initialize pushed_macros
933 member.
934 (cpp_destroy): Free elements in pushed_macros member.
935 * pch.c (_cpp_save_pushed_macros): New function.
936 (_cpp_restore_pushed_macros): Likewise.
937 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
938 (cpp_read_state): Use _cpp_restore_pushed_macros.
939
2c6e3f55
JJ
9402009-10-19 Jakub Jelinek <jakub@redhat.com>
941
942 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
943 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
944 and char32_cset_desc.
945 (converter_for_type): Handle CPP_UTF8STRING.
946 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
947 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
948 (parse_include): Reject raw strings.
949 * include/cpplib.h (CPP_UTF8STRING): New token type.
950 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
951 * lex.c (lex_raw_string): New function.
952 (lex_string): Handle u8 string literals, call lex_raw_string
953 for raw string literals.
954 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
955 sequences.
956 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
957
96c169e1
JJ
9582009-10-14 Jakub Jelinek <jakub@redhat.com>
959
960 PR preprocessor/41543
961 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
962 * line-map.c (linemap_init): Initialize highest_location and
963 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
964
30c99a9e
JM
9652009-10-09 Jason Merrill <jason@redhat.com>
966
967 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
968
2214382c
NV
9692009-10-09 Neil Vachharajani <nvachhar@google.com>
970
971 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
972 sccs.
973
e02222d2
LR
9742009-09-23 Loren J. Rittle <ljrittle@acm.org>
975
976 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
977 * configure: Rebuilt.
978
9a8a2b7a
RG
9792009-09-22 Richard Guenther <rguenther@suse.de>
980
981 PR pch/38987
982 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
983
74dc6a11
CD
9842009-09-18 Chris Demetriou <cgd@google.com>
985
986 PR preprocessor/28435:
987 * include/cpplib.h (struct cpp_options): Add new member
988 deps.need_preprocessor_output.
989 * files.c (open_file_failed): If preprocessor output is needed
990 always report an error.
991
933608b7
KT
9922009-09-13 Kai Tietz <kai.tietz@onevision.com>
993
994 * configure.ac: Set for i?86-w64-mingw*
995 need_64bit_hwint to yes.
996 * configure: Regenerated.
997
86373e7e
JM
9982009-09-10 Jason Merrill <jason@redhat.com>
999
1000 * directives.c (cpp_define): constify.
1001
fd2ab214
ILT
10022009-09-02 Ian Lance Taylor <iant@google.com>
1003
1004 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
1005
df58e648
RW
10062009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1007
1008 * configure.ac (AC_PREREQ): Bump to 2.64.
1009
5213506e
RW
10102009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1011
1012 * aclocal.m4: Regenerate.
1013 * config.in: Regenerate.
1014 * configure: Regenerate.
1015
709a22df
TT
10162009-08-17 Tom Tromey <tromey@redhat.com>
1017
1018 PR preprocessor/41067:
1019 * charset.c (convert_escape): Add missing ":" to error text.
1020
0c539b47
DR
10212009-07-27 Douglas B Rupp <rupp@gnat.com>
1022
1023 * include/cpplib.h (INO_T_CPP): New macro.
1024 (struct cpp_dir): Use it.
1025
2b69c841
JQ
10262009-07-20 Jerry Quinn <jlquinn@optonline.net>
1027
1028 PR regression/40800
1029 * configure.ac: Use = instead of == for testing
1030 ENABLE_BUILD_WITH_CXX.
1031 * configure: Rebuild.
1032
f1bf410c
JQ
10332009-07-17 Jerry Quinn <jlquinn@optonline.net>
1034
1035 * directives.c (do_linemarker, do_line): Use CPP_STRING for
1036 ignored enum value.
1037 * files.c (find_file_in_dir): Add cast from void* to char*.
1038 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
1039 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
1040 warnings.
1041 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
1042 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
1043 COMPILER_FLAGS): New.
1044 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
1045 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
1046 instead of ALL_CFLAGS.
1047 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
1048 from other warnings. Add -Wc++-compat to C-specific warnings.
1049 Check for --enable-build-with-cxx. Set and substitute
1050 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
1051 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
1052 AC_CHECK_HEADERS.
1053 * configure: Rebuild.
1054 * include/cpp-id-data.h: Remove extern "C".
1055 * include/line-map.h: Likewise.
1056 * include/mkdeps.h: Likewise.
1057 * include/symtab.h: Likewise.
1058 * internal.h: Likewise.
1059
a28fbdba
MLI
10602009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1061
1062 * directives.c (parse_include): Add location argument. Update all
1063 calls.
1064 (parse_answer): Likewise.
1065 (do_include_common): Error with exact location.
1066 (parse_assertion): Likewise.
1067
b506a5a2
MLI
10682009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
1069
1070 * expr.c (num_div_op): Take explicit location.
1071
7d8847a4
ILT
10722009-06-17 Ian Lance Taylor <iant@google.com>
1073
1074 * include/cpplib.h (progname): Don't declare.
1075
3d8b2a98
ILT
10762009-06-12 Ian Lance Taylor <iant@google.com>
1077
1078 * include/cpplib.h (struct cpp_options): Add
1079 warn_cxx_operator_names field.
1080 (NODE_WARN_OPERATOR): Define.
1081 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
1082 type to 6 bits.
1083 * init.c (mark_named_operators): Add flags parameter.
1084 (cpp_post_options): Pick flags value to pass to
1085 mark_named_operators.
1086 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
1087 identifier is an operator name in C++.
1088
e74fe492
AH
10892009-06-01 Aldy Hernandez <aldyh@redhat.com>
1090
1091 * include/line-map.h (LAST_SOURCE_COLUMN): New.
1092
4851089f
ILT
10932009-06-01 Ian Lance Taylor <iant@google.com>
1094
1095 * include/cpp-id-data.h: Add extern "C".
1096 * include/line-map.h: Likewise.
1097 * include/mkdeps.h: Likewise.
1098 * include/symtab.h: Likewise.
1099 * internal.h: Likewise.
1100
7e5487a2
ILT
11012009-05-15 Ian Lance Taylor <iant@google.com>
1102
1103 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
1104 builtin_type. Change all uses.
1105
00b0c19b
MLI
11062009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1107
1108 PR cpp/36674
1109 * directives (do_linemarker): Compensate for the increment in
1110 location that occurs when we reach the end of line.
1111 * files (_cpp_stack_include): Mention _cpp_find_file in the
1112 comment.
1113
9a0c6187
JM
11142009-05-10 Joseph Myers <joseph@codesourcery.com>
1115
1116 * include/cpplib.h (enum cpp_token_fld_kind): Add
1117 CPP_TOKEN_FLD_TOKEN_NO.
1118 (struct cpp_macro_arg, struct cpp_identifier): Define.
1119 (union cpp_token_u): Use struct cpp_identifier for identifiers.
1120 Use struct cpp_macro_arg for macro arguments. Add token_no for
1121 CPP_PASTE token numbers.
1122 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
1123 do_pragma_poison, parse_assertion): Use val.node.node in place of
1124 val.node.
1125 * expr.c (parse_defined, eval_token): Use val.node.node in place
1126 of val.node.
1127 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
1128 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
1129 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
1130 place of val.arg_no. Use val.node.node in place of val.node.
1131 * macro.c (replace_args, cpp_get_token, parse_params,
1132 lex_expansion_token, create_iso_definition, cpp_macro_definition):
1133 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
1134 Use val.node.node in place of val.node.
1135
9e322bc1
JM
11362009-05-03 Joseph Myers <joseph@codesourcery.com>
1137
1138 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
1139 UTF-8 sequences.
1140
f88d0772
JM
11412009-04-25 Joseph Myers <joseph@codesourcery.com>
1142
1143 PR preprocessor/39559
1144 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
1145 constants larger than intmax_t in C99 mode.
1146
d1b38208
TG
11472009-04-21 Taras Glek <tglek@mozilla.com>
1148
1149 * include/cpp-id-data.h: Update GTY annotations to new syntax.
1150 * include/cpplib.h: Likewise.
1151 * include/line-map.h: Likewise.
1152 * include/symtab.h: Likewise.
1153
cfc93532
MLI
11542009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1155
1156 PR c++/14875
1157 * lex.c (cpp_type2name): Take a flags parameter. Call
1158 cpp_named_operator2name for named operators and cpp_digraph2name
1159 for digraphs.
1160 (cpp_digraph2name): New.
1161 (cpp_spell_token): Use it.
1162 (cpp_output_token): Likewise.
1163 * include/cpplib.h (cpp_type2name): Update declaration.
1164 * init.c (cpp_named_operator2name): New.
1165 * internal.h (cpp_named_operator2name): Declare.
1166
9c650d90
MLI
11672009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1168
1169 PR c++/13358
1170 * init.c (cpp_create_reader): Wlong_long is disabled by default.
1171 * expr.c (cpp_classify_number): Give different messages for C and
1172 C++ front-ends.
1173
aa508502
JM
11742009-04-19 Joseph Myers <joseph@codesourcery.com>
1175
1176 PR preprocessor/20078
1177 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
1178 field.
1179 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
1180 (struct cpp_token): Change flags to unsigned short.
1181 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
1182 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
1183 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
1184 tokens.
1185 * macro.c (macro_real_token_count): New.
1186 (enter_macro_context, replace_args): Use macro_real_token_count.
1187 (create_iso_definition): Record whitespace surrounding and digraph
1188 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
1189 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
1190 multiple consecutive ## tokens.
1191 (_cpp_create_definition): Initialize extra_tokens.
1192 (cpp_macro_definition): Use macro_real_token_count.
1193
61cc8223
JM
11942009-04-18 Joseph Myers <joseph@codesourcery.com>
1195
1196 * directives.c (parse_include): Pass true to check_eol.
1197
c7f9c0b9
JM
11982009-04-18 Joseph Myers <joseph@codesourcery.com>
1199
1200 PR preprocessor/39646
1201 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
1202 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
1203 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
1204 place of LC_RENAME.
1205
a5cb563b
JM
12062009-04-18 Joseph Myers <joseph@codesourcery.com>
1207
1208 PR preprocessor/39647
1209 * directives.c (check_eol): Add parameter expand.
1210 (do_undef, parse_include, do_line, do_linemarker, do_ident,
1211 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
1212 do_else, do_endif, do_assert, do_unassert): All callers changed.
1213 Pass true from do_line, false elsewhere.
1214
18f41a1b
JM
12152009-04-12 Joseph Myers <joseph@codesourcery.com>
1216
1217 PR preprocessor/31869
1218 * macro.c (stringify_arg): Handle NULL source token in padding
1219 token where previous padding token did not have source token with
1220 preceding whitespace.
1221
748086b7
JJ
12222009-04-09 Jakub Jelinek <jakub@redhat.com>
1223
1224 * Makefile.in: Change copyright header to refer to version
1225 3 of the GNU General Public License and to point readers at the
1226 COPYING3 file and the FSF's license web page.
1227 * charset.c: Likewise.
1228 * directives-only.c: Likewise.
1229 * directives.c: Likewise.
1230 * errors.c: Likewise.
1231 * expr.c: Likewise.
1232 * files.c: Likewise.
1233 * identifiers.c: Likewise.
1234 * include/cpp-id-data.h: Likewise.
1235 * include/cpplib.h: Likewise.
1236 * include/line-map.h: Likewise.
1237 * include/mkdeps.h: Likewise.
1238 * include/symtab.h: Likewise.
1239 * init.c: Likewise.
1240 * internal.h: Likewise.
1241 * lex.c: Likewise.
1242 * line-map.c: Likewise.
1243 * macro.c: Likewise.
1244 * makeucnid.c: Likewise.
1245 * mkdeps.c: Likewise.
1246 * pch.c: Likewise.
1247 * symtab.c: Likewise.
1248 * system.h: Likewise.
1249 * traditional.c: Likewise.
1250 * ucnid.tab: Likewise.
1251 * ucnid.h: Regenerate.
1252
eec49116
JJ
12532009-04-01 Janis Johnson <janis187@us.ibm.com>
1254
839a3b8a
JJ
1255 PR c/39027
1256 * include/cpplib.h (CPP_N_DEFAULT): Define.
1257 * expr.c (interpret_float_suffix): Recognize d or D for double,
1258 return new value for default.
1259 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
1260
eec49116
JJ
1261 PR c/33466
1262 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
1263 letters from decimal float and fixed-point suffixes.
1264
47580d22
JM
12652009-03-31 Joseph Myers <joseph@codesourcery.com>
1266
1267 PR preprocessor/15638
1268 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
1269 invalid PCH.
1270 (open_file_failed): Make error for missing file fatal.
1271 * include/cpplib.h (CPP_DL_FATAL): Define.
1272
5a2df0fa
SV
12732009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
1274
1275 PR preprocessor/31932:
1276 * internal.h: Don't mention HAVE_ICONV_H.
1277 * configure, config.in: Rebuild.
1278 * configure.ac: Don't check for iconv.h.
1279
c1a8a3c6
TT
12802009-03-30 Tom Tromey <tromey@redhat.com>
1281
1282 PR preprocessor/39512:
1283 * line-map.c (linemap_init): Initialize 'reallocator' field.
1284
a37a7b8a
JJ
12852009-03-30 Jakub Jelinek <jakub@redhat.com>
1286
1287 PR target/39558
1288 * macro.c (cpp_get_token): If macro_to_expand returns NULL
1289 and used some tokens, add CPP_PADDING before next token.
1290
148e4216
JM
12912009-03-29 Joseph Myers <joseph@codesourcery.com>
1292
1293 PR preprocessor/34695
1294 * makedepend.c: Remove.
1295 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
1296 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
1297 * directives.c (cpp_errors): Remove.
1298 * errors.c (print_location, _cpp_begin_message, v_message):
1299 Remove.
1300 (cpp_error, cpp_error_with_line): Always use error callback.
1301 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
1302 * include/cpplib.h (cpp_options): Remove pedantic_errors,
1303 inhibit_warnings, warn_system_headers, inhibit_errors,
1304 warnings_are_errors, client_diagnostic.
1305 (cpp_callbacks): Add extra arguments to error callback; make it
1306 return bool.
1307 (cpp_finish): Return void.
1308 (cpp_destroy): Remove inaccurate comment about return value.
1309 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
1310 (CPP_DL_NOTE): Define.
1311 * include/line-map.h (linemap_print_containing_files): Remove.
1312 * init.c (cpp_finish): Do not check for or return number of
1313 errors.
1314 * internal.h (cpp_reader): Remove errors field.
1315 * line-map.c (linemap_print_containing_files): Remove.
1316 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
1317 about previous definition. Only emit it if previous diagnostic
1318 was emitted.
1319
f1450211
JM
13202009-03-28 Joseph Myers <joseph@codesourcery.com>
1321
1322 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
1323 mkinstalldirs.
1324
8f5929e1
JJ
13252009-03-18 Jakub Jelinek <jakub@redhat.com>
1326
1327 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
1328
4bb09c26
JM
13292009-02-21 Joseph Myers <joseph@codesourcery.com>
1330
1331 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
1332 header name.
1333 (_cpp_lex_direct): Handle this.
1334
68c9ab45
RG
13352009-02-15 Richard Guenther <rguenther@suse.de>
1336
1337 Revert last change.
1338
601b3e1a
RG
13392009-02-13 Richard Guenther <rguenther@suse.de>
1340
1341 * configure.ac: Enable LFS.
1342 * configure: Re-generate.
1343 * config.in: Likewise.
1344
fc0cd180
BE
13452009-01-05 Ben Elliston <bje@au.ibm.com>
1346
1347 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
1348 (.po.pox): Likewise.
1349 (po/$(PACKAGE).pot): Likewise.
1350
db89a3be
AO
13512008-12-10 Alexandre Oliva <aoliva@redhat.com>
1352
1353 PR target/37033
1354 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
1355 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
1356
cc955282
JM
13572008-11-29 Joseph Myers <joseph@codesourcery.com>
1358
1359 * lex.c (cpp_token_len): Use 6 as default length.
1360
47960aaf
MLI
13612008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
1362
1363 * expr.c (struct op): Add location.
1364 (_cpp_parse_expr): Propagate locations throught the stack
1365 of expressions.
1366 (reduce): Likewise.
1367 (check_promotion): Use explicit location in errors.
1368
631d0d36
MG
13692008-10-05 Matthew Gingell <gingell@adacore.com>
1370 Arnaud Charlet <charlet@adacore.com>
1371
1372 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
1373 (cpp_get_comments): New function.
1374 * internal.h (struct cpp_reader): Add comments field.
1375 * init.c (cpp_destroy): Free comments.
1376 * lex.c (store_comment, cpp_get_comments): New functions.
1377 (comments): New struct.
1378 (save_comment): Store comments in comments struct.
1379
c047ce93
SB
13802008-09-18 Simon Baldwin <simonb@google.com>
1381
1382 * include/cpplib.h (struct cpp_options): Add new boolean flag
1383 warn_builtin_macro_redefined.
1384 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
1385 * (struct builtin_operator): Split out from previous struct builtin,
1386 enhance extra const correctness.
1387 * (struct builtin_macro): Split out from previous struct builtin, add
1388 new always_warn_if_redefined flag, enhance const correctness.
1389 * (mark_named_operators): Use struct builtin_operator.
1390 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
1391 to builtins selectively.
1392 * macro.c (warn_of_redefinition): Return false if a builtin macro
1393 is not flagged with NODE_WARN.
1394
affa55c6
JJ
13952008-07-31 Jakub Jelinek <jakub@redhat.com>
1396
1397 PR preprocessor/36649
1398 * files.c (struct report_missing_guard_data): New type.
1399 (report_missing_guard): Put paths into an array instead of printing
1400 them right away. Return 1 rather than 0.
1401 (report_missing_guard_cmp): New function.
1402 (_cpp_report_missing_guards): Sort and print paths gathered by
1403 report_missing_guard callback.
1404
3b8f20a1
MLI
14052008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1406
1407 PR 28079
1408 * directives.c (strtolinenum): Handle overflow.
1409 (do_line): Give a warning if line number overflowed.
1410 (do_linemarker): Update call to strtolinenum.
1411
1bb64668
MLI
14122008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1413
1414 * include/line-map.h (linenum_type): New typedef.
1415 (struct line_map): Use it.
1416 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
1417 (SOURCE_COLUMN): Likewise.
1418 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
1419 source_location values in a variable of type linenum_type.
1420 * directives.c (struct if_stack): Use linenum_type.
1421 (strtoul_for_line): Rename as strtolinenum.
1422 (do_line): Use linenum_type.
1423 (do_linemarker): Use linenum_type and strtolinenum.
1424 (_cpp_do_file_change): Use linenum_t.
1425 * line-map.c (linemap_add): Likewise.
1426 (linemap_line_start): Likewise.
1427 * traditional.c (struct fun_macro): 'line' is a source_location.
1428 * errors.c (print_location): Use linenum_type.
1429 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
1430 * internal.h (CPP_INCREMENT_LINE): Likewise.
1431 * lex.c (_cpp_skip_block_comment): Use source_location.
1432
5950c3c9
BE
14332008-07-14 Ben Elliston <bje@au.ibm.com>
1434
1435 * include/cpplib.h (NODE_CONDITIONAL): New.
1436 (struct cpp_callbacks): New macro_to_expand field.
1437 (struct cpp_hashnode): Adjust size of flags and type fields.
1438 (cpp_peek_token): Prototype.
1439 * lex.c (cpp_peek_token): New function.
1440 (_cpp_temp_token): Protect pre-existing lookaheads.
1441 * macro.c (cpp_get_token): Expand any conditional macros.
1442 (_cpp_backup_tokens_direct): New.
1443 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
1444 (warn_of_redefinition): Silently allow redefined conditional
1445 macros.
1446 (_cpp_create_definition): Remove the conditional flag when a user
1447 defines one of the conditional macros.
1448 * internal.h (_cpp_backup_tokens_direct): New prototype.
1449
e85edc9e
AH
14502008-06-13 Andrew Haley <aph@redhat.com>
1451
1452 PR preprocessor/33305
1453 * macro.c (replace_args): Print a warning for empty macro
1454 arguments in C89 and C++.
1455
18c04407
RW
14562008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1457
1458 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
1459 * configure: Regenerate.
1460
2d09b640
RW
14612008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1462
1463 * Makefile.in (datarootdir): New variable.
1464
0b7c73cc
L
14652008-06-12 H.J. Lu <hongjiu.lu@intel.com>
1466
1467 PR preprocessor/36479
1468 * charset.c (cpp_interpret_string_notranslate): Also set
1469 narrow_cset_desc.width.
1470
cd985f66
JM
14712008-06-07 Joseph Myers <joseph@codesourcery.com>
1472
1473 * configure.ac (parisc*64*-*-*): Remove.
1474 * configure: Regenerate.
1475
d750887f
TT
14762008-05-30 Tom Tromey <tromey@redhat.com>
1477
1478 PR preprocessor/36320:
1479 * internal.h (_cpp_parse_expr): Update.
1480 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
1481 messages.
1482 * directives.c (do_if): Update.
1483 (do_elif): Require expression if processing group.
1484
c100de59
DS
14852008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
1486
1487 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
1488
5d6342eb
TT
14892008-05-21 Tom Tromey <tromey@redhat.com>
1490
1491 PR preprocessor/27777:
1492 * lex.c (cpp_output_line_to_string): New function.
1493 * internal.h (_cpp_begin_message): Don't declare.
1494 * errors.c (_cpp_begin_message): Now static.
1495 * include/cpplib.h (cpp_output_line_to_string): Declare.
1496 * directives.c (do_diagnostic): Rewrote. Use
1497 cpp_output_line_to_string. Don't use _cpp_begin_message.
1498
dae4174e
TT
14992008-05-21 Tom Tromey <tromey@redhat.com>
1500
1501 * include/symtab.h (HT_ALLOCED): Remove.
1502 (ht_purge): Declare.
1503 * symtab.c (DELETED): New define.
1504 (ht_lookup): Update comment.
1505 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
1506 code. Use subobject allocator for strings, if it exists.
1507 (ht_expand): Handle deleted entries.
1508 (ht_forall): Likewise.
1509 (ht_purge): New function.
1510 (ht_dump_statistics): Print deletion statistics.
1511
899015a0
TT
15122008-05-13 Tom Tromey <tromey@redhat.com>
1513
1514 PR preprocessor/22168:
1515 * include/cpplib.h (struct cpp_options) <objc>: Update
1516 documentation.
1517 * expr.c (eval_token): Warn for use of assertions.
1518 * directives.c (directive_diagnostics): Warn about extensions.
1519 (DEPRECATED): New define.
1520 (DIRECTIVE_TABLE): Use it.
1521
71c10038
TT
15222008-05-06 Tom Tromey <tromey@redhat.com>
1523
1524 PR preprocessor/35313, PR preprocessor/36088:
1525 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
1526 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
1527
2bd0fe3d
DM
15282008-05-04 David S. Miller <davem@davemloft.net>
1529
1530 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
1531 * configure: Regenerate.
1532
28f68625
DF
15332008-04-22 Daniel Franke <franke.daniel@gmail.com>
1534
1535 * include/cpplib.h (cpp_define_formatted): New.
1536 * directives.c (cpp_define_formatted): New.
1537
688e7a53
TT
15382008-04-21 Tom Tromey <tromey@redhat.com>
1539
1540 PR libcpp/33415:
1541 * charset.c (_cpp_convert_input): Add buffer_start argument.
1542 Ignore UTF-8 BOM if seen.
1543 * internal.h (_cpp_convert_input): Add argument.
1544 * files.c (struct _cpp_file) <buffer_start>: New field.
1545 (destroy_cpp_file): Free buffer_start, not buffer.
1546 (_cpp_pop_file_buffer): Likewise.
1547 (read_file_guts): Update.
1548
b6baa67d
KVH
15492008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1550
1551 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
1552 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
1553 (struct cpp_options): Added uliterals.
1554 (cpp_interpret_string): Update prototype.
1555 (cpp_interpret_string_notranslate): Idem.
1556 * charset.c (init_iconv_desc): New width member in cset_converter.
1557 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
1558 (convert_ucn): Idem.
1559 (emit_numeric_escape): Idem.
1560 (convert_hex): Idem.
1561 (convert_oct): Idem.
1562 (convert_escape): Idem.
1563 (converter_for_type): New function.
1564 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
1565 (cpp_interpret_string_notranslate): Match changed prototype.
1566 (wide_str_to_charconst): Use converter_for_type.
1567 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
1568 * directives.c (linemarker_dir): Macro U changed to UC.
1569 (parse_include): Idem.
1570 (register_pragma_1): Idem.
1571 (restore_registered_pragmas): Idem.
1572 (get__Pragma_string): Support CPP_STRING{16,32}.
1573 * expr.c (eval_token): Support CPP_CHAR{16,32}.
1574 * init.c (struct lang_flags): Added uliterals.
1575 (lang_defaults): Idem.
1576 * internal.h (struct cset_converter) <width>: New field.
1577 (struct cpp_reader) <char16_cset_desc>: Idem.
1578 (struct cpp_reader) <char32_cset_desc>: Idem.
1579 * lex.c (digraph_spellings): Macro U changed to UC.
1580 (OP, TK): Idem.
1581 (lex_string): Add support for u'...', U'...', u"..." and U"...".
1582 (_cpp_lex_direct): Idem.
1583 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
1584 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
1585
deb984e6
PB
15862008-04-18 Paolo Bonzini <bonzini@gnu.org>
1587
1588 PR bootstrap/35457
1589 * aclocal.m4: Regenerate.
1590 * configure: Regenerate.
1591
bf048bea
TT
15922008-04-17 Tom Tromey <tromey@redhat.com>
1593
1594 PR libcpp/34866:
1595 * errors.c (cpp_error): Don't reference a token before the start
1596 of the current run.
1597
7f27b0f8
TT
15982008-04-16 Tom Tromey <tromey@redhat.com>
1599
1600 * Makefile.in (TAGS_SOURCES): New variable.
1601 (TAGS): New target.
1602
a1fcb9a1
KK
16032008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
1604
1605 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
1606 and shbe-*-*.
1607 * configure: Rebuilt.
1608
93d45d9e
JM
16092008-04-02 Joseph Myers <joseph@codesourcery.com>
1610
1611 * include/cpplib.h (struct cpp_callbacks): Add used_define,
1612 used_undef and before_define.
1613 (NODE_USED): Define.
1614 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
1615 do_ifndef, cpp_pop_definition): Handle new flag and use new
1616 callbacks.
1617 * expr.c (parse_defined): Handle new flag and use new callbacks.
1618 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
1619 flag and use new callbacks.
1620
d4c32e1d
JJ
16212008-04-01 Jakub Jelinek <jakub@redhat.com>
1622
1623 PR pch/13675
1624 * files.c (struct _cpp_file): Remove pch field.
1625 (pch_open_file): Don't set file->pch, just file->pchname.
1626 (should_stack_file): After pfile->cb.read_pch call
1627 free pchname and clear pchname, don't close file->fd.
1628 Test file->pchname instead of file->pch. Don't close fd after cb.
1629 (_cpp_stack_include): Test file->pchname instead of file->pch.
1630
161031e3
TT
16312008-03-28 Tom Tromey <tromey@redhat.com>
1632
1633 * Makefile.in (POSTCOMPILE): New variable.
1634 (.c.o): Use it.
1635
14ccf800
TT
16362008-03-13 Tom Tromey <tromey@redhat.com>
1637
1638 PR libcpp/35322:
1639 * directives.c (destringize_and_run): Set pfile->directive.
1640
830465c6
MM
16412008-03-06 Markus Milleder <markus.milleder@generali.at>
1642
1643 PR preprocessor/35458
1644 * mkdeps.c (munge): Quote '#' with a '\'.
1645
d482a073
RW
16462008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1647
1648 PR preprocessor/35379
1649 * mkdeps.c (deps_write): Ensure the first target always appears
1650 in the first column, without leading backslash newline. Avoid
1651 some more extra whitespace.
1652
185a6cc1
TS
16532008-02-25 Thiemo Seufer <ths@mips.com>
1654
d482a073 1655 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 1656
2bf41bf0
TT
16572008-02-19 Tom Tromey <tromey@redhat.com>
1658
1659 * traditional.c (lex_identifier): Use CPP_HASHNODE.
1660 * lex.c (lex_identifier): Use CPP_HASHNODE.
1661 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
1662 do-while.
1663 * identifiers.c (alloc_node): Change return type.
1664 (_cpp_init_hashtable): Don't cast 'alloc_node'.
1665 (proxy_assertion_broken): New declaration.
1666 (cpp_forall_identifiers): Move comment.
1667 * line-map.c (linemap_add): Comment fix.
1668 (linemap_line_start): Indentation fix.
1669
765d600a
JJ
16702008-01-25 Jakub Jelinek <jakub@redhat.com>
1671
1672 PR preprocessor/34692
1673 * macro.c (collect_args): Add pragma_buff argument. Push
1674 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
1675 than into arguments. Reset prevent_expansion and parsing_args
1676 state at CPP_PRAGMA_EOL/CPP_EOF.
1677 (funlike_invocation_p): Add pragma_buff argument, pass it through
1678 to collect_args.
1679 (enter_macro_context): Add result argument. Adjust
1680 funlike_invocation_p caller. Emit all deferred pragma tokens
1681 gathered during collect_args before the expansion, add a padding
1682 token. Return 2 instead of 1 if any pragma tokens were prepended.
1683 (cpp_get_token): If enter_macro_context returns 2, don't return
1684 a padding token, instead cycle to grab CPP_PRAGMA token.
1685 * directives.c (_cpp_handle_directive): If was_parsing_args
1686 in deferred pragma, leave parsing_args and prevent_expansion as is.
1687
ec46053b
TT
16882008-01-22 Tom Tromey <tromey@redhat.com>
1689
765d600a 1690 PR c++/34859
ec46053b
TT
1691 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
1692 __STDC_CONSTANT_MACROS.
1693
681c6ab0
FF
16942008-01-07 Fred Fish <fnf@specifix.com>
1695
765d600a 1696 PR preprocessor/30363
681c6ab0
FF
1697 * traditional.c (replace_args_and_push): Add local variable
1698 cxtquote, calculate the replacement text size assuming a
1699 worst case of every input character quoted with backslash,
1700 and properly handle output quoting of quote characters in
1701 actual arguments used in function-like macros.
1702
33ae4837
TT
17032008-01-03 Tom Tromey <tromey@redhat.com>
1704
765d600a 1705 PR preprocessor/34602
33ae4837
TT
1706 * directives.c (do_line): Don't try to spell EOF token.
1707 (do_linemarker): Add comment.
1708
675575f5
DD
17092007-12-11 DJ Delorie <dj@redhat.com>
1710
1711 * charset.c (convert_using_iconv): Close out any shift states,
1712 returning to the initial state.
1713
97f6bd40
TT
17142007-12-06 Tom Tromey <tromey@redhat.com>
1715
765d600a 1716 PR c/29172
97f6bd40
TT
1717 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
1718 type.
1719 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
1720 * files.c (FILE_HASH_POOL_SIZE): New macro.
1721 (struct file_hash_entry_pool): New.
1722 (destroy_all_cpp_files): New function.
1723 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
1724 (new_file_hash_entry): Update.
1725 (free_file_hash_entries): New function.
1726 (_cpp_cleanup_files): Call free_file_hash_entries and
1727 destroy_all_cpp_files.
1728 (cpp_clear_file_cache): New function.
1729 * include/cpplib.h (cpp_clear_file_cache): Declare.
1730
d56a25e1
TT
17312007-12-03 Tom Tromey <tromey@redhat.com>
1732
765d600a 1733 PR preprocessor/34288
d56a25e1
TT
1734 * configure.ac, config.in: Rebuilt.
1735 * configure.ac: Check for ssize_t.
1736
607f74e9
TT
17372007-11-30 Tom Tromey <tromey@redhat.com>
1738
765d600a 1739 PR preprocessor/32868
607f74e9
TT
1740 * macro.c (_cpp_create_definition): Special case
1741 __STDC_FORMAT_MACROS.
1742
b0f4807f
MM
17432007-11-16 Michael Matz <matz@suse.de>
1744
1745 * files.c (search_path_head): Fix check for absolute paths.
1746
f1e20710
TT
17472007-11-11 Tom Tromey <tromey@redhat.com>
1748
765d600a 1749 PR c++/17557
f1e20710
TT
1750 * include/cpplib.h (cpp_included_before): Declare.
1751 * files.c (struct file_hash_entry) <location>: New field.
1752 (_cpp_find_file): Initialize new field.
1753 (make_cpp_dir): Likewise.
1754 (cpp_included_before): New function.
1755
f373b44d
TT
17562007-11-01 Tom Tromey <tromey@redhat.com>
1757
765d600a 1758 PR preprocessor/30805
f373b44d
TT
1759 * macro.c (paste_tokens): Handle padding token.
1760 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
1761
5b9a40df
TT
17622007-10-31 Tom Tromey <tromey@redhat.com>
1763
765d600a 1764 PR preprocessor/30786
5b9a40df
TT
1765 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
1766 * directives.c (_cpp_do__Pragma): Return error status.
1767 * internal.h (_cpp_do__Pragma): Update.
1768 * directives.c (get__Pragma_string): Back up if EOF seen.
1769
5ffeb913
TT
17702007-09-06 Tom Tromey <tromey@redhat.com>
1771
1772 * internal.h (struct cpp_reader) <invocation_location>: New
1773 field.
1774 (struct cpp_reader) <set_invocation_location>: Likewise.
1775 * init.c (cpp_set_line_map): New function.
1776 * line-map.c (linemap_add): Use linemap's allocator.
1777 * include/line-map.h (GTY): Define.
1778 (line_map_realloc): New typedef.
1779 (struct line_map): Mark with GTY.
1780 (struct line_maps): Likewise.
1781 (struct line_maps) <maps>: Likewise.
1782 (struct line_maps) <reallocator>: New field.
1783 * include/symtab.h (GTY): Conditionally define.
1784 * include/cpplib.h (cpp_set_line_map): Declare.
1785 (cpp_get_token_with_location): Declare.
1786 * macro.c (cpp_get_token): Set invocation_location on the reader.
1787 (cpp_get_token_with_location): New function.
1788
ac6b1c67
CF
17892007-08-30 Chao-ying Fu <fu@mips.com>
1790
1791 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
1792 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
1793 (cpp_classify_number): Support decimal fixed-point constants without
1794 exponents.
1795 Warn about fixed-point constants when -pedantic.
1796 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
1797 comments to support fixed-point values.
1798 (CPP_N_FRACT, CPP_N_ACCUM): Define.
1799
cda5e672
TT
18002007-08-18 Tom Tromey <tromey@redhat.com>
1801
765d600a 1802 PR preprocessor/32974
cda5e672
TT
1803 * directives.c (parse_include): Don't check for EOL when
1804 processing #pragma dependency.
1805
ccfc4c91
OW
18062007-07-30 Ollie Wild <aaw@google.com>
1807
1808 * directives-only.c: New file.
1809 * internal.h (struct _cpp_dir_only_callbacks): New.
1810 (_cpp_preprocess_dir_only): New function.
1811 * directives.c (_cpp_handle_directive): Check directives_only before
1812 disabling execution of indented directives.
1813 * files.c (_cpp_stack_file): Add directives_only check.
1814 * include/cpplib.h (struct cpp_options): Add directives_only.
1815 (cpp_init_special_builtins): New function.
1816 * init.c (cpp_init_special_builtins): New function.
1817 (cpp_init_builtins): Move builtin_array initialization to
1818 cpp_init_special_builtins.
1819 (post_options): Check directives_only before setting
1820 pfile->state.prevent_expansion = 1.
1821 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
1822 is expanded inside a directive while -fdirectives-only is enabled.
1823 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
1824 (libcpp_a_SOURCES): Add directives-only.c.
1825
a206413a
UB
18262007-07-04 Uros Bizjak <ubizjak@gmail.com>
1827
1828 * traditional.c (_cpp_scan_out_logical_line): Initialize
1829 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
1830 fmacro.args to prevent 'may be used uninitialized' warning.
1831
c77cd3d1
UB
18322007-07-03 Uros Bizjak <ubizjak@gmail.com>
1833
1834 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
1835 Add new constants.
1836 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
1837 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
1838 for 'q' or 'Q' suffixes.
1839
66938a1d
DS
18402007-06-17 Danny Smith <dannysmith@users.sourceforge.net
1841
e1311401 1842 * files.c (open_file): Correct typo.
66938a1d 1843
71995ede
VP
18442007-06-16 Vladimir Prus <vladimir@codesourcery.com>
1845
e1311401 1846 * files.c (open_file): Prevent the call
71995ede
VP
1847 for stat from overwriting errno.
1848
84152c25
VP
18492007-06-09 Vladimir Prus <vladimir@codesourcery.com>
1850
e1311401 1851 * files.c (open_file): Account for the
84152c25
VP
1852 fact that on windows, opening a directory gives
1853 EACCES.
1854
f7fd775f
JW
18552007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
1856
1857 PR preprocessor/23479
1858 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
1859 integer constants.
1860 (append_digit): Likewise.
1861 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
1862 binary integer constants.
1863
ed0e74e0
DK
18642007-05-31 Dave Korn <dave.korn@artimi.com>
1865
1866 PR preprocessor/14331
1867 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
1868
a702045a
OW
18692007-05-24 Ollie Wild <aaw@google.com>
1870
1871 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
1872 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
1873 (cpp_write_pch_state): Save __COUNTER__ state.
1874 (cpp_valid_state): Check valid __COUNTER__ state.
1875 (cpp_read_state): Read new __COUNTER__ state.
1876 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
1877 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
1878 * internal.h (struct cpp_reader): Add counter member.
1879
126e073b
SM
18802007-05-23 Simon Martin <simartin@users.sourceforge.net>
1881
1882 PR preprocessor/20077
1883 * macro.c (create_iso_definition): Fixed the method to determine
1884 whether the token-pasting operator appears at the beginning or the end
1885 of a macro.
1886
0b4cafec
ILT
18872007-05-21 Ian Lance Taylor <iant@google.com>
1888
1889 * internal.h (struct cpp_reader): Add new fields:
1890 nonexistent_file_hash and nonexistent_file_ob.
1891 * files.c: Include "obstack.h".
1892 (find_file_in_dir): Before trying to open the file, look up the
1893 path name in the hash table of nonexistent files. After failing
1894 to open the file, add the path name to the hash table.
1895 (_cpp_find_file): Cache the results of looking up the file name
1896 starting with the quote and bracket chain heads, if we can.
1897 (nonexistent_file_hash_eq): New static function.
1898 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
1899 pfile->nonexistent_file_ob.
1900 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
1901 pfile->nonexistent_file_ob.
1902
30e04921
JJ
19032007-05-14 Janis Johnson <janis187@us.ibm.com>
1904
5a6bb57e
JJ
1905 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
1906
30e04921
JJ
1907 PR c/31924
1908 * expr.c (interpret_float_suffix): Check for invalid suffix.
1909
22a8a52d
EC
19102007-05-02 Eric Christopher <echristo@apple.com>
1911
1912 * expr.c (num_div_op): Don't overflow if the result is
1913 zero.
1914
fca35e1b
TT
19152007-05-02 Tom Tromey <tromey@redhat.com>
1916
765d600a 1917 PR preprocessor/28709
fca35e1b
TT
1918 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
1919
4cd97075
MM
19202007-03-30 Michael Meissner <michael.meissner@amd.com>
1921
1922 * directives.c (lex_macro_node_from_str): Fix alloca call to be
1923 type correct.
1924
121de39f
RH
19252007-03-30 Richard Henderson <rth@redhat.com>
1926
1927 * directives.c (lex_macro_node_from_str): New.
1928 (cpp_push_definition, cpp_pop_definition): New.
1929 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
1930
4fcb360b
BM
19312007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1932
1933 * Makefile.in: Add dummy install-pdf target.
1934
67e64439
TT
19352007-01-30 Tom Tromey <tromey@redhat.com>
1936
765d600a 1937 PR preprocessor/30468
67e64439
TT
1938 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
1939 './'.
1940
ee380365
TT
19412007-01-30 Tom Tromey <tromey@redhat.com>
1942
765d600a 1943 PR preprocessor/29966
ee380365
TT
1944 * macro.c (lex_expansion_token): Save and restore cpp_reader's
1945 cur_token.
1946 (_cpp_create_definition): Don't restore cur_token here.
1947 * lex.c (_cpp_lex_token): Added assertion.
1948
024abeb3
TT
19492007-01-27 Tom Tromey <tromey@redhat.com>
1950
1951 * configure: Rebuilt.
1952
ee1c2a10
TT
19532007-01-12 Tom Tromey <tromey@redhat.com>
1954
765d600a 1955 PR preprocessor/28227
ee1c2a10
TT
1956 * directives.c (lex_macro_node): Added 'is_def_or_undef'
1957 argument.
1958 (do_define): Update.
1959 (do_undef): Update.
1960 (do_ifdef): Update.
1961 (do_ifndef): Update.
1962
67214c16
PB
19632007-01-11 Paolo Bonzini <bonzini@gnu.org>
1964
1965 * configure: Regenerate.
1966
1aa6ca40
PB
19672007-01-11 Paolo Bonzini <bonzini@gnu.org>
1968
1969 * configure: Regenerate.
1970
705e2d28
TT
19712007-01-04 Tom Tromey <tromey@redhat.com>
1972
765d600a 1973 PR preprocessor/28165
705e2d28
TT
1974 * internal.h (cpp_in_primary_file): New function.
1975 * directives.c (do_include_next): Use cpp_in_primary_file.
1976 (do_pragma_once): Likewise.
1977 (do_pragma_system_header): Likewise.
1978
7af45bd4
ILT
19792006-12-29 Ian Lance Taylor <iant@google.com>
1980
1981 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
1982 look backward at the end of the line unless we saw a backslash.
1983
9d30f270
JJ
19842006-12-29 Jakub Jelinek <jakub@redhat.com>
1985
1986 PR preprocessor/29612
1987 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
1988 only when new_sysp is non-zero.
1989
30b0edc0
TT
19902006-12-28 Tom Tromey <tromey@redhat.com>
1991
765d600a 1992 PR preprocessor/30001
30b0edc0
TT
1993 * charset.c (_cpp_convert_input): Check that to.len is greater
1994 than zero.
1995
85d9c13c
TS
19962006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
1997
1998 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 1999 * configure: Rebuilt.
85d9c13c 2000
dfafdaa6
DG
20012006-11-01 Douglas Gregor <doug.gregor@gmail.com>
2002
2003 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
2004 for experimental C++0x mode.
2005 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
2006 adopted the preprocessor changes introduced in C99.
2007
0f45f0f5
JM
20082006-10-29 Joseph Myers <joseph@codesourcery.com>
2009
2010 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
2011 depending on --enable-targets=all.
2012 * configure: Regenerate.
2013
de000d22
JJ
20142006-10-12 Jakub Jelinek <jakub@redhat.com>
2015
2016 PR preprocessor/28709
2017 * macro.c (paste_tokens): Do error reporting here, use BUF with the
2018 spelled LHS token as opposed to spelling it again.
2019 (paste_all_tokens): Don't report errors here, just break on failure.
2020
b5422ad7
BM
20212006-10-10 Brooks Moses <bmoses@stanford.edu>
2022
2023 * Makefile.in: Added empty "pdf" target.
2024
aaf50ff2
GK
20252006-09-22 Geoffrey Keating <geoffk@apple.com>
2026
2027 * configure.ac: Make need_64_bit_hwint case for x86-darwin
2028 match exactly the glob in gcc/config.gcc.
2029 * configure: Regenerate.
2030
c663e301
JM
20312006-09-13 Joseph S. Myers <joseph@codesourcery.com>
2032
2033 PR c/28768
2034 PR preprocessor/14634
2035 * lex.c (lex_string): Pedwarn for unterminated literals.
2036
f7288899
EC
20372006-09-08 Eric Christopher <echristo@apple.com>
2038
2039 * configure.ac: Add 64-bit HWI support for i?86-darwin.
2040
b52dbbf8
SE
20412006-08-14 Steve Ellcey <sje@cup.hp.com>
2042
2043 PR c++/28288
2044 PR c++/14556
2045 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
2046 (CPP_LAST_EQ): Change.
2047 (CPP_LAST_PUNCTUATOR): Change.
2048 * expr.c (cpp_operator): Remove MIN and MAX.
2049 (reduce): Remove CPP_MIN and CPP_MAX.
2050 (num_binary_op): Ditto.
2051 * lex.c (_cpp_lex_direct): Ditto.
2052 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
2053
1c90c6f9
JJ
20542006-06-09 Jakub Jelinek <jakub@redhat.com>
2055
2056 PR preprocessor/27746
2057 * directives.c (do_pragma): Handle pragma with valid namespace
2058 and invalid name coming from macro expansion.
2059 * directives.c (destringize_and_run): Initialize next field in
2060 context.
2061
2062 PR c/27747
2063 PR c++/27748
2064 * directives.c (destringize_and_run): Set NO_EXPAND on the
2065 tokens.
2066
2067 * macro.c (_cpp_backup_tokens): Fix comment typo.
2068
5c3c3683
DJ
20692006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
2070
2071 * Makefile.in (CATALOGS): Add po/ prefix.
2072 * configure: Regenerated.
2073
b2bd74bc
CD
20742006-05-23 Carlos O'Donell <carlos@codesourcery.com>
2075
2076 * Makefile.in: Add install-html target. Add install-html to .PHONY
2077
be8ac3e2
GZ
20782006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
2079
2080 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
2081 * files.c (_cpp_get_file_stat): New function.
2082 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
2083 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
2084 * internal.h (_cpp_get_file_stat): Prototype.
2085 (struct cpp_buffer): Add timestamp.
2086
83900997
JJ
20872006-01-23 Jakub Jelinek <jakub@redhat.com>
2088
2089 PR preprocessor/25717
2090 * init.c (cpp_init_builtins): If __STDC__ will not change value
2091 between system headers and other sources, define it as a normal
2092 macro rather than a builtin.
2093 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
2094 cpp_in_system_header condition.
2095
20962006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
2097
2098 * Makefile.in: Use -MMD instead of -MD.
2099
bc4071dd
RH
21002006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
2101 Richard Henderson <rth@redhat.com>
2102
2103 Merge from gomp branch:
2104 * directives.c (struct pragma_entry): Add is_deferred. Add ident
2105 entry to value union.
2106 (end_directive): Don't eat the line if in_deferred_pragma.
2107 (run_directive): Remove pragma hacks.
2108 (insert_pragma_entry): Remove.
2109 (new_pragma_entry): New.
2110 (register_pragma_1): Split out of register_pragma. Only handle
2111 the lookup tree and return the new entry.
2112 (cpp_register_pragma): Fill in the pragma entry here.
2113 (cpp_register_deferred_pragma): New.
2114 (register_pragma_internal): New.
2115 (_cpp_init_internal_pragmas): Use register_pragma_internal.
2116 (do_pragma): Allow pragma expansion after namespace. For deferred
2117 pragmas, don't slurp the line into a string.
2118 (destringize_and_run): Save tokens for deferred pragmas.
2119 (cpp_handle_deferred_pragma): Remove.
2120 * macro.c (builtin_macro): Remove pragma token hack.
2121 (_cpp_push_token_context): Rename from push_token_context and export.
2122 * internal.h (struct lexer_state): Add pragma_allow_expansion.
2123 (_cpp_push_token_context): Declare.
2124 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
2125 a token. Update the line number correctly if so.
2126 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
2127 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
2128 * include/cpplib.h (PRAGMA_EOL): New.
2129 (CPP_TOKEN_FLD_PRAGMA): New.
2130 (struct cpp_token): Add val.pragma.
2131 (struct cpp_options): Remove defer_pragmas.
2132 (cpp_handle_deferred_pragma): Remove.
2133 (cpp_register_deferred_pragma): Declare.
2134
d09e893f
JJ
21352006-01-01 Jakub Jelinek <jakub@redhat.com>
2136
2137 PR c++/25294
2138 * directives.c (do_pragma): If pragma line ends with multi-line
2139 block comment, end the saved deferred pragma string before that
2140 comment. Handle embedded '\0' chars on the pragma line.
2141
ab84748a
VR
21422005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
2143
2144 PR c++/23333
2145 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
2146
ad6ed77e
JG
21472005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
2148 Ben Elliston <bje@au.ibm.com>
2149
2150 * include/cpplib.h (CPP_N_DFLOAT): New.
2151 * expr.c (interpret_float_suffix): Identify df, dd, and dl
2152 suffixes as decimal floating point constants.
2153 (cpp_classify_number): Disallow hexadecimal DFP constants.
2154
ba096620 21552005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 2156 Ian Lance Taylor <ian@airs.com>
ba096620
GP
2157
2158 * include/cpplib.h (struct cpp_callbacks): Annotate error with
2159 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
2160
456b8ce5
UB
21612005-11-09 Per Bothner <per@bothner.com>
2162 Uros Bizjak <uros@kss-loka.si>
f7288899 2163
456b8ce5
UB
2164 PR c/24101
2165 * init.c (read_original_filename): Temporarily set
2166 state.in_directive before calling _cpp_lex_direct for
2167 CPP_HASH tokens.
2168
5571f74f
JW
21692005-11-03 James E Wilson <wilson@specifix.com>
2170
2171 PR preprocessor/24202
2172 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
2173
a63607ed
JM
21742005-11-04 Joseph S. Myers <joseph@codesourcery.com>
2175
2176 * include/cpplib.h (struct cpp_callbacks): Make error take
2177 va_list* parameter.
2178 * errors.c (cpp_error): Update call to callback.
2179
651ed942
AP
21802005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
2181
2182 PR preprocessor/22042
2183 * macro.c (_cpp_builtin_macro_text): Lower the needed max
2184 buffer size.
2185 (cpp_quote_string): Don't octalify non printable
2186 charactors.
2187
178b58b5
JM
21882005-11-03 Joseph S. Myers <joseph@codesourcery.com>
2189
2190 PR c++/17964
2191 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
2192 (struct cpp_callbacks): Add error.
2193 * errors.c (cpp_error): If client_diagnostic, use error callback.
2194 * charset.c (convert_escape): Don't use %03o in diagnostic.
2195
3ee5ed11 21962005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
2197
2198 PR preprocessor/15220
2199 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
2200 callers. Pass to open_file_failed.
2201 (open_file_failed): New parameter angle_brackets. Fix all callers.
2202 Use in print_dep assignment.
2203 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
2204 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 2205
077fc835
KH
22062005-10-08 Kazu Hirata <kazu@codesourcery.com>
2207
2208 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
2209 * configure: Regenerate.
2210
cbc43ae0
ILT
22112005-10-04 Ian Lance Taylor <ian@airs.com>
2212
2213 PR preprocessor/13726
2214 * directives.c (check_eol_return_comments): New static function.
2215 (parse_include): Add buf parameter. Change all callers.
2216 (do_include_common): If not discard comments, turn on
2217 save_comments. Pass collected comments to include callback.
2218 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
2219 include callback: cpp_token list.
2220
af15a2fe
JM
22212005-09-20 Joseph S. Myers <joseph@codesourcery.com>
2222
2223 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
2224 * init.c (struct lang_flags, lang_defaults): Add
2225 extended_identifiers.
2226 (cpp_set_lang): Use it.
2227 * lex.c (forms_identifier_p): Check extended_identifiers.
2228
f5eab47e
JJ
22292005-08-30 Jakub Jelinek <jakub@redhat.com>
2230
2231 PR preprocessor/20348
2232 PR preprocessor/20356
2233 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
2234 2004-06-05 changes.
2235
467129e6
KG
22362005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2237
2238 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
2239 -Wmissing-format-attribute.
2240
2241 * configure: Regenerate.
2242
200031d1
KC
22432005-06-29 Kelley Cook <kcook@gcc.gnu.org>
2244
2245 * all files: Update FSF address in copyright headers.
2246 * makeucnid.c (write_copyright): Update outputted FSF address.
2247
f610dd5f
ZW
22482005-06-13 Zack Weinberg <zack@codesourcery.com>
2249
2250 * configure.ac: Invoke ZW_CREATE_DEPDIR and
2251 ZW_PROG_COMPILER_DEPENDENCIES.
2252 * aclocal.m4, configure: Regenerate.
2253 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
2254 New variables.
2255 (distclean): Clean up $(DEPDIR) and its contents.
2256 (.c.o): Use $(COMPILE).
2257 Include $(DEPDIR)/*.Po for most object->header dependencies.
2258
c3f829c1
GDR
22592005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2260
2261 * configure.ac: Check declarations for asprintf and vasprintf.
2262 * config.in: Regenerate.
2263 * configure: Likewise.
2264
2265 * charset.c (conversion_loop): Use XRESIZEVEC.
2266 (convert_no_conversion): Likewise.
2267 (convert_using_iconv): Likewise.
2268 (init_iconv_desc): Cast return value of alloca.
2269 (cpp_host_to_exec_charset): Use XNEWVEC.
2270 (emit_numeric_escape): Use XRESIZEVEC.
2271 (cpp_interpret_string): Use XNEWVEC.
2272 (cpp_interpret_string): Use XRESIZEVEC.
2273 (_cpp_interpret_identifier): Cast return value of alloca.
2274 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
2275 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
2276 (parse_include): Use XNEWVEC.
2277 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 2278 "new_entry".
c3f829c1
GDR
2279 (save_registered_pragmas): Cast return value of xmemdup.
2280 (destringize_and_run): Same for alloca.
2281 (parse_assertion): Likewise.
2282 (do_assert): Cast allocated storage to proper type.
2283 (cpp_define): Likewise.
2284 (_cpp_define_builtin): Likewise.
2285 (cpp_undef): Likewise.
2286 (handle_assertion): Likewise.
2287 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
2288 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
2289 (CPP_UMINUS): Likewise.
2290 (struct cpp_operator): Rename from struct operator.
2291 (_cpp_expand_op_stack): Use XRESIZEVEC.
2292 * files.c (pch_open_file): Use XNEWVEC.
2293 (pch_open_file): Use XRESIZEVEC.
2294 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
2295 (dir_name_of_file): Use XNEWVEC.
2296 (make_cpp_file): Use XCNEW.
2297 (make_cpp_dir): Likewise.
2298 (allocate_file_hash_entries): USE XNEWVEC.
2299 (cpp_included): Cast return value of htab_find_with_hash.
2300 (append_file_to_dir): Use XNEWVEC.
2301 (read_filename_string): Likewise. Use XRESIZEVEC too.
2302 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
2303 (remap_filename): Use XNEWVEC.
2304 (struct pchf_entry): Move definition out of struct pchf_data.
2305 (_cpp_save_file_entries): Use XCNEWVAR.
2306 (_cpp_read_file_entries): Use XNEWVAR.
2307 * identifiers.c (alloc_node): Use XOBNEW.
2308 * init.c (cpp_create_reader): Use XCNEW.
2309 (cpp_init_builtins): Cast of b->value to enum builtin_type.
2310 (read_original_directory): Cast return value of alloca.
2311 * lex.c (add_line_note): Use XRESIZEVEC.
2312 (warn_about_normalization): Use XNEWVEC.
2313 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
2314 (new_buff): Use XNEWVEC.
2315 * line-map.c (linemap_add): Use XRESIZEVEC.
2316 * macro.c (builtin_macro): Cast return value of alloca.
2317 (paste_tokens): Likewise.
2318 (expand_arg): Use XNEWVEC and XRESIZEVEC.
2319 (_cpp_save_parameter): Use XRESIZEVEC.
2320 (create_iso_definition): Cast allocated storage to proper type.
2321 (_cpp_create_definition): Likewise.
2322 (cpp_macro_definition): Use XRESIZEVEC.
2323 * makedepend.c (add_clm): Use XNEW.
2324 (add_dir): Likewise.
2325 * mkdeps.c (munge): Use XNEWVEC.
2326 (deps_init): Use XCNEW.
2327 (deps_add_target): Use XRESIZEVEC.
2328 (deps_add_default_target): Cast return value of alloca.
2329 (deps_add_dep): Use XRESIZEVEC.
2330 (deps_add_vpath): Likewise. Use XNEWVEC too.
2331 (deps_restore): Likewise.
2332 * pch.c (save_idents): Use XNEW and XNEWVEC.
2333 (cpp_save_state): Use XNEW.
2334 (count_defs): Cast return value of htab_find.
2335 (write_defs): Likewise.
2336 (cpp_write_pch_deps): Use XNEWVEC.
2337 (collect_ht_nodes): Use XRESIZEVEC.
2338 (cpp_valid_state): Use XNEWVEC.
2339 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
2340 * symtab.c (ht_create): Use XCNEW.
2341 (ht_lookup_with_hash): Cast return value of obstack_copy0.
2342 (ht_expand): Use XCNEWVEC.
2343 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
2344 (bool): Do not define if __cplusplus.
2345
1ed17cd5
ZW
23462005-05-12 Zack Weinberg <zack@codesourcery.com>
2347
2348 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
2349 (do_sccs): Delete function definition, #define to do_ident.
2350 (do_ident): Don't hardwire directive name.
2351
5a8c20ce
RK
23522005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
2353
2354 PR bootstrap/21230
2355 * configure: Regenerate.
2356
473c5bc9
AP
23572005-04-27 Andris Pavenis <pavenis@latnet.lv>
2358
2359 * files.c: Include io.h for DJGPP to get prototype of setmode.
2360
c1fc5047
PB
23612005-04-19 Per Bothner <per@bothner.com>
2362
2363 PR preprocessor/20907
2364 * line-map.c (linemap_line_start): Fix bug when we need to increse
2365 column_bits but can re-use the current line_map.
2366
042630ad
KG
23672005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2368
2369 * system.h (fopen, fdopen, freopen): Define these to the unlocked
2370 libiberty functions.
2371
0d667716
KG
23722005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2373
2374 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
2375 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
2376 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
2377 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
2378 _unlocked function.
2379 (fwrite_unlocked): Fix prototype.
1ed17cd5 2380
0d667716
KG
2381 * configure, config.in: Regenerate.
2382
cae064e7
JJ
23832005-04-05 Jakub Jelinek <jakub@redhat.com>
2384
2385 PR preprocessor/19475
2386 * macro.c (create_iso_definition): For < ISO C99, don't
2387 pedwarn if there is no whitespace between macro name and its
2388 replacement, but the replacement starts with a basic character
2389 set character.
2390
cbada204
AJ
23912005-03-28 Andreas Jaeger <aj@suse.de>
2392
2393 * lex.c (warn_about_normalization): Cast field width to int to
2394 avoid warning.
2395
f42eccdb
JM
23962005-03-19 Joseph S. Myers <joseph@codesourcery.com>
2397
2398 * configure.ac: Consistently use solaris2.1[0-9]* instead of
2399 solaris2.1[0-9].
2400 * configure: Regenerate.
2401
c79e602b
GK
24022005-03-15 Geoffrey Keating <geoffk@apple.com>
2403
2404 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
2405 UCN rather than printing an error.
2406
50668cf6
GK
24072005-03-14 Geoffrey Keating <geoffk@apple.com>
2408
6baba9bb
GK
2409 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
2410
24112005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 2412
50668cf6
GK
2413 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
2414 * charset.c: Update for new format of ucnid.h.
2415 (ucn_valid_in_identifier): Update for new format of ucnid.h.
2416 Add NST parameter, and update it; update callers.
2417 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
2418 with cpp_error.
2419 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
2420 * internal.h (struct normalize_state): New.
2421 (INITIAL_NORMALIZE_STATE): New.
2422 (NORMALIZE_STATE_RESULT): New.
2423 (NORMALIZE_STATE_UPDATE_IDNUM): New.
2424 (_cpp_valid_ucn): New.
2425 * lex.c (warn_about_normalization): New.
2426 (forms_identifier_p): Add normalize_state parameter, update callers.
2427 (lex_identifier): Add normalize_state parameter, update callers. Keep
2428 the state current.
2429 (lex_number): Likewise.
2430 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
2431 it with warn_about_normalization.
2432 * makeucnid.c: New.
2433 * ucnid.h: Replace.
2434 * ucnid.pl: Remove.
2435 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
2436 comments about obsolete version of C++.
2437 * include/cpplib.h (enum cpp_normalize_level): New.
2438 (struct cpp_options): Add warn_normalize field.
2439
47e20491
GK
24402005-03-11 Geoffrey Keating <geoffk@apple.com>
2441
2442 * directives.c (glue_header_name): Update call to cpp_spell_token.
2443 * internal.h (_cpp_interpret_identifier): New.
2444 * charset.c (_cpp_interpret_identifier): New.
2445 (_cpp_valid_ucn): Allow UCN version of '$'.
2446 * lex.c (lex_identifier): Add extra parameter to indicate if initial
2447 character was '$' or '\'. Support identifiers with UCNs.
2448 (forms_identifier_p): Allow UCNs.
2449 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
2450 (utf8_to_ucn): New.
2451 (cpp_spell_token): Add FORSTRING parameter. Use it.
2452 (cpp_token_as_text): Update call to cpp_spell_token.
2453 (cpp_output_token): Write UCNs back out.
2454 (stringify_arg): Update call to cpp_spell_token.
2455 (paste_tokens): Likewise.
2456 (cpp_macro_definition): Likewise.
2457 * macro.c (stringify_arg): Likewise.
2458 (paste_tokens): Likewise.
2459 (cpp_macro_definition): Likewise.
2460 * include/cpplib.h: Add parameter to cpp_spell_token.
2461
73096711
JJ
24622005-03-04 Jakub Jelinek <jakub@redhat.com>
2463
2464 PR bootstrap/20282
2465 PR bootstrap/20305
2466 * macro.c (replace_args, cpp_get_token): Copy whole
2467 cpp_token_u instead of just cpp_string field from it.
2468
2203a881
DP
24692005-02-28 Devang Patel <dpatel@apple.com>
2470
2471 * directives.c (do_line): Save sysp early before line table is
2472 realloc'ed.
1ed17cd5 2473
c5ff069d
ZW
24742005-02-20 Zack Weinberg <zack@codesourcery.com>
2475
2476 PR 18785
2477 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
2478 (cpp_host_to_exec_charset): New function.
2479 * include/cpplib.h: Declare cpp_host_to_exec_charset.
2480
04c90eea
DP
24812005-02-19 Devang Patel <dpatel@apple.com>
2482
2483 * charset.c (_cpp_convert_input): Check '\r' before inserting
2484 '\n' at the end.
c5ff069d 2485
6da55c00
EC
24862005-02-15 Eric Christopher <echristo@redhat.com>
2487
2488 PR preprocessor/19077
2489 * macro.c (cpp_macro_definition): Move handling of whitespace
2490 to PREV_WHITE conditional. Remove overloading of len
2491 variable.
2492
31c3e631
KH
24932005-02-14 Kazu Hirata <kazu@cs.umass.edu>
2494
2495 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
2496 traditional.c: Update copyright.
2497
be0f1e54
PB
24982005-02-14 Paolo Bonzini <bonzini@gnu.org>
2499
2500 PR bootstrap/19818
2501 * configure.ac: Check for declaration of basename and getopt.
2502 * config.in: Regenerate.
2503 * configure: Regenerate.
2504 * internal.h (ustrcspn): New.
2505 * macro.c (create_iso_definition): Fix allocation of memory.
2506 (padding_token): Add cast to remove const-ness.
2507 * pch.c (cpp_read_state): Use ustrcspn.
2508
ecddfb39
MS
25092005-02-08 Mike Stump <mrs@apple.com>
2510
2511 * files.c (pchf_adder): Remove.
2512 (struct pchf_adder_info): Likewise.
2513 (_cpp_save_file_entries): Write out all files so that #import works.
2514
9fcdd891
JM
25152005-01-23 Joseph S. Myers <joseph@codesourcery.com>
2516
2517 * configure: Regenerate.
2518
ecfd72e7
TS
25192005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
2520
2521 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
2522
6c25a4f7 2523 * include/cpplib.h: Also update copyright years.
c5ff069d 2524
942926ad
GK
25252005-01-03 Geoffrey Keating <geoffk@apple.com>
2526
2527 * files.c (_cpp_find_file): Add files found by search_path_exhausted
2528 to the list of all files.
2529
a2566ae9
GDR
25302005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
2531
2532 * internal.h: Update references to Cpp lib filenames.
2533 * directives.c: Likewise.
2534 * init.c: Likewise.
2535 * macro.c: Likewise.
2536 * traditional.c: Likewise.
2537
1b449375
EB
25382004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
2539
2540 PR preprocessor/15167
2541 * files.c (destroy_cpp_file): New function.
2542 (should_stack_file): Make a new file if the
2543 compared file is still stacked.
2544
28303828
NN
25452004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
2546
c5ff069d 2547 PR preprocessor/17610
28303828
NN
2548 * directives.c (do_include_common): Error out if an empty filename
2549 is given for #include (or #include_next or #import).
2550
c812785a
RS
25512004-11-27 Roger Sayle <roger@eyesopen.com>
2552 Zack Weinberg <zack@codesourcery.com>
2553
2554 * internal.h: Replace all uses of uchar with unsigned char.
2555 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
2556 with !IN_GCC, so uchar is only defined whilst building libcpp.
2557
f91eaa01
KC
25582004-11-24 Kelley Cook <kcook@gcc.gnu.org>
2559
2560 * aclocal.m4: Regenerate.
2561
f78ce0c2
RS
25622004-11-24 Roger Sayle <roger@eyesopen.com>
2563
2564 PR preprocessor/15824
2565 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
2566 directly, instead of the non-existant "system.h" and "ansidecl.h".
2567 * configure: Regenerate.
2568
b5b3e36a 25692004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 2570 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
2571
2572 * internal.h (struct lexer_state): Add in_deferred_pragma.
2573 * directives.c (struct pragma_entry): Add allow_expansion.
2574 (insert_pragma_entry): Take allow_expansion flag.
2575 (register_pragma): Likewise.
2576 (cpp_register_pragma): Likewise.
2577 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
2578 (do_pragma): Honor allow_expansion.
2579 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
2580 * include/cpplib.h (cpp_register_pragma): Update prototype.
2581
a8e68029 25822004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 2583 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
2584
2585 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
2586 need_64bit_hwint=yes.
2587 * configure: Regenerate.
2588
50f47ee0
JM
25892004-11-09 Joseph S. Myers <joseph@codesourcery.com>
2590
2591 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
2592 po/$(PACKAGE).pot.
2593 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
2594 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
2595 Remove local srcdir path from generated file.
2596
968e08d6 25972004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 2598 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
2599
2600 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
2601 as well.
2602
3da3d587
ZW
26032004-10-27 Zack Weinberg <zack@codesourcery.com>
2604
2605 PR 18075
2606 * directives.c (do_pragma): Do not defer pragmas which are unknown.
2607 (cpp_handle_deferred_pragma): Add cast to silence warning.
2608
ac24fc25
JM
26092004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
2610
2611 * errors.c (_cpp_begin_message): Print "error: " for errors.
2612
7731405b
AJ
26132004-10-10 Andreas Jaeger <aj@suse.de>
2614
2615 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
2616 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
2617
646544e3
AP
26182004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
2619
2620 * pch.c (cpp_write_pch_state): Remove variable z as it is not
2621 used.
2622 (cpp_read_state): Remove unused variables, m, d and mac_count.
2623
67a74146
PB
26242004-09-29 Per Bothner <per@bothner.com>
2625
2626 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
2627 cb.line_change. Otherwise do_pragma will call the line_change
2628 call-back with a meaningless line number.
2629
018a4785
ZW
26302004-09-24 Zack Weinberg <zack@codesourcery.com>
2631
2632 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
2633 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
2634 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
2635 * aclocal.m4, configure: Regenerate.
2636 * init.c: Include localedir.h.
2637 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
2638 (DEFS): Delete.
2639 (.c.o): Use $(ALL_CFLAGS).
2640 (localedir.h, localedir.hs): New rules.
2641 (clean): Use rm -rf to remove directories.
2642 (distclean): Also delete localedir.h and localedir.hs.
2643 (init.o): Update dependencies.
2644
88fa57d7
KC
26452004-09-22 Kelley Cook <kcook@gcc.gnu.org>
2646
2647 * Makefile.in (aclocal.m4): Update dependencies.
2648 * configure.ac (AC_CONFIG_MACRO_DIR): New.
2649 * aclocal.m4, configure: Regenerate.
2650
8f8e9aa5
ZW
26512004-09-17 Zack Weinberg <zack@codesourcery.com>
2652
a29f62d9
ZW
2653 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
2654 (_cpp_convert_input, _cpp_default_encoding): Add comments.
2655 Some other comments in this file also tweaked.
2656
8f8e9aa5
ZW
2657 * directives.c (do_pragma): Save current buffer position
2658 before lexing the pragma keywords; don't call
2659 _cpp_backup_tokens in the defer_pragmas case.
2660
a2981930
PB
26612004-09-15 Per Bothner <per@bothner.com>
2662
2663 * include/line-map.h (line_map_start): Add parameter names so
2664 preceding comment makes sense.
2665 (linemap_add): Remove from comment mention of non-existing parameter.
2666
21b11495
ZW
26672004-09-09 Matt Austern <austern@apple.com>
2668 Zack Weinberg <zack@codesourcery.com>
2669
2670 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
2671 prefixes throughout. Add entry for PRAGMA. Remove
2672 unnecessary "= 0" from EQ.
2673 (enum cpp_ttype): Adjust OP and TK definitions to restore
2674 prefixes, via token-paste.
2675 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
2676 Change from #defines to additional cpp_ttype enumerators.
2677 (struct cpp_options): Add defer_pragmas.
2678 (cpp_handle_deferred_pragma): Prototype new interface.
2679
2680 * internal.h (struct cpp_reader): Add directive_result.
2681 * directives.c (struct pragma_entry): Add is_internal field;
2682 give boolean fields type bool.
2683 (start_directive): Initialize pfile->directive_result.type.
2684 (_cpp_do__Pragma): Likewise.
2685 (run_directive): Do not crash if pfile->buffer->prev is NULL.
2686 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
2687 from it.
2688 (register_pragma): New static function, bulk of former
2689 cpp_register_pragma here; add 'internal' argument, pass along
2690 to insert_pragma_entry.
2691 (cpp_register_pragma): Now a wrapper around register_pragma which
2692 always passes false for 'internal' argument.
2693 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
2694 true for 'internal'.
2695 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
2696 an internal pragma, save text till the end of the line as a CPP_PRAGMA
2697 token instead of executing the pragma.
2698 (cpp_handle_deferred_pragma): New interface.
2699 * lex.c (token_spellings): Adjust OP and TK definitions to
2700 match changes to cpplib.h.
2701 (_cpp_lex_token): Check for a directive-result token and
2702 return it if present.
2703 (cpp_token_val_index): Handle CPP_PRAGMA.
2704 * macro.c (cpp_builtin_macro_text): Correct comment.
2705 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
2706
0fd9e8dd
SB
27072004-09-06 Serge Belyshev <belyshev@lubercy.com>
2708
2709 PR preprocessor/14699
2710 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
2711 from size_t to double.
2712
39b8ce7f
AS
27132004-08-28 Andreas Schwab <schwab@suse.de>
2714 Andreas Jaeger <aj@suse.de>
2715
2716 * configure.ac: Set PACKAGE correctly.
2717 * configure: Regenerated.
2718
5d1f4b27
PB
27192004-08-25 Paolo Bonzini <bonzini@gnu.org>
2720
2721 * Makefile.in: Add back top_builddir.
2722
078e3ffe
PB
27232004-08-25 Paolo Bonzini <bonzini@gnu.org>
2724
2725 * configure.ac: Replace Automake macro invocations
2726 with manual Autoconf checks and substitutions.
2727 * configure: Regenerate.
2728 * aclocal.m4: Regenerate.
2729 * config.in: Regenerate.
2730 * Makefile.am: Removed.
2731 * Makefile.in: Heavy simplification and reorganization.
2732
b3f8d95d
MM
27332004-08-09 Mark Mitchell <mark@codesourcery.com>
2734
2735 * configure.ac (arm*-*-eabi*): New target.
2736 (arm*-*-symbianelf*): Likewise.
2737 * configure: Regenerated.
2738
72bb2c39
BI
27392004-07-24 Bernardo Innocenti <bernie@develer.com>
2740
2741 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
2742 * directives.c: Use XNEW-family macros from libiberty.
2743 * lex.c: Likewise.
2744 * macro.c: Likewise.
2745 * cpplib.h (cpp_deps_style): Export enum with name.
2746
21b11495 27472004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 2748
21b11495 2749 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 2750
a23ee064
AP
27512004-07-16 Andris Pavenis <pavenis@latnet.lv>
2752
2753 PR preprocessor/16366
2754 * internal.h (struct cpp_reader): New field dir_hash.
2755 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
2756 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
2757
a09d4744
NB
27582004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
2759
2760 PR preprocessor/16192
2761 PR preprocessor/15913
2762 PR preprocessor/15572
2763 * expr.c (_cpp_parse_expr): Handle remaining cases where an
2764 expression is missing.
2765 * init.c (post_options): Traditional cpp doesn't do // comments.
2766
f58f7def
PB
27672004-06-30 Per Bothner <per@bothner.com>
2768
2769 * include/line-map.h (fileline): Remove old typedef.
2770 * internal.h (struct cpp_reader): Use source_location typedef instead.
2771
e83d8d43
ZW
27722004-06-26 Zack Weinberg <zack@codesourcery.com>
2773
2774 Partially revert patch of 2004-06-05.
2775 * files.c (search_cache): Remove pfile argument. Don't check
2776 for file that would be found by "" or <> search here...
2777 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
2778 Do not apply directory-of-current-file correction to files
2779 found by this check. Rearrange code slightly.
2780
c0d578e6
GK
27812004-06-21 Geoffrey Keating <geoffk@apple.com>
2782
2783 * files.c (should_stack_file): Correct swapped parameters to call
2784 to cb.read_pch.
2785 * pch.c (cpp_valid_state): Handle -fpreprocessed.
2786
159d5224
PB
27872004-06-15 Paolo Bonzini <bonzini@gnu.org>
2788
2789 * Makefile.in: Regenerate with automake 1.8.5.
2790 * aclocal.m4: Likewise.
2791 * configure: Regenerate.
2792
2fac9c01
ZW
27932004-06-11 Zack Weinberg <zack@codesourcery.com>
2794
2795 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
2796 * configure, config.in: Regenerate.
2797 * system.h: Unconditionally define bool as unsigned char,
2798 BOOL_BITFIELD as unsigned int.
2799 * .cvsignore: New file.
2800
d8044160
GK
28012004-06-09 Geoffrey Keating <geoffk@apple.com>
2802
2803 * traditional.c (push_replacement_text): Set macro->traditional.
2804 (save_replacement_text): Likewise.
2805 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
2806 (struct save_macro_item): Delete.
2807 (struct save_macro_data): Use a character array not the previous
2808 structured format.
2809 (save_macros): Save macro as text not as internal structures.
2810 (cpp_prepare_state): Update for changes to save_macro_data.
2811 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 2812 -D macros as text.
d8044160
GK
2813 * macro.c (create_iso_definition): Honour alloc_subobject.
2814 Clear traditional flag.
2815 (_cpp_create_definition): Honour alloc_subobject.
2816 * lex.c (cpp_token_val_index): New.
2817 * internal.h: Include cpp-id-data.h.
2818 (uchar): Move definition to cpp-id-data.h.
2819 (U): Likewise.
2820 (cpp_macro): Likewise.
2821 * directives.c (struct answer): Move to cpp-id-data.h.
2822 (do_assert): Honour alloc_subobject.
2cf22451
ZW
2823
2824 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
2825 * include/cpplib.h (struct cpp_string): Add GTY marker.
2826 (enum cpp_token_fld_kind): New.
2827 (struct cpp_token): Add GTY markers.
2828 (cpp_token_val_index): Prototype.
2829 (CPP_HASHNODE_VALUE_IDX): New.
2830 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
2831 * include/cpp-id-data.h: New file.
d8044160 2832
0ca8e815
PB
28332004-06-09 Paolo Bonzini <bonzini@gnu.org>
2834
2835 * Makefile.am (all-local): New.
2836 * Makefile.in: Regenerate.
2837
b51fa00f
RS
28382004-06-06 Roger Sayle <roger@eyesopen.com>
2839
2840 * Makefile.am (LIBICONV): Declare.
2841 (makedepend_LDADD): Use LIBICONV.
2842 * Makefile.in: Regenerate.
2843
5e2f3f39
AP
28442004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
2845
2846 * Makefile.am (LIBINTL): Declare
2847 (makedepend_LDADD): Use LIBINTL.
2848 * Makefile.in: Regenerate.
2849
c6e83800
ZW
28502004-06-05 Zack Weinberg <zack@codesourcery.com>
2851
2852 * Makefile.am: Add makedepend.
2853 * Makefile.in, aclocal.m4: Regenerate.
2854 * charset.c: Insert a space to avoid a warning.
2855 * directives.c: Include mkdeps.h.
2856 (_cpp_handle_directive): Reenable macro expander if appropriate.
2857 (undefine_macros): Inline body of _cpp_free_definition for speed.
2858 Do not call undef callback or _cpp_warn_if_unused_macro.
2859 (cpp_get_deps): New interface.
2860 * files.c (search_cache): Add pfile argument. Check for file
2861 that would be found by "" or <> search here...
2862 (_cpp_find_file): ...not here. Correct recorded start_dir of
2863 files found by directory-of-current-file search that would be
2864 found by "" or <> search.
2865 * init.c (cpp_add_dependency_target): Delete.
2866 * internal.h (struct lexer_state): Add discarding_output flag.
2867 * lex.c (lex_identifier): Compute hash function while scanning.
2868 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
2869 directives.
2870 * makedepend.c: New file.
2871 * mkdeps.c (struct deps): Add vpath vector.
2872 (apply_vpath, deps_add_vpath): New function.
2873 (deps_free): Free vpath vector.
2874 (deps_add_dep, deps_add_target): Use apply_vpath.
2875 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
2876 (ht_lookup_with_hash): New function.
2877 * cpplib.h, mkdeps.h: Update prototypes.
2878 * symtab.h: Update prototypes.
2879 (HT_HASHSTEP, HT_FINISH): New macros.
2880
b453c95f
GK
28812004-05-29 Geoffrey Keating <geoffk@apple.com>
2882
2883 * symtab.c (ht_create): Set entries_owned.
2884 (ht_destroy): Honour entries_owned.
2885 (ht_expand): Likewise.
2886 (ht_load): New.
2cf22451
ZW
2887 * include/symtab.h (struct ht): New field 'entries_owned'
2888 (ht_load): New prototype.
b453c95f 2889
963e23c5
PB
28902004-05-26 Paolo Bonzini <bonzini@gnu.org>
2891
2892 PR bootstrap/15651
2893 * configure.ac: Fix m4 quoting when picking
2894 the size of HOST_WIDE_INT.
2895 * configure: Regenerate.
2896
0429bc77
PB
28972004-05-25 Paolo Bonzini <bonzini@gnu.org>
2898
2899 * Makefile.am: the correct directory for
2900 gettext include files is given by @INCINTL@.
2901 * Makefile.in: Regenerate.
2902
c86dd7db
PB
29032004-05-24 Paolo Bonzini <bonzini@gnu.org>
2904
2905 * system.h [!ENABLE_NLS]: dgettext takes two
2906 parameters.
2907
4f4e53dd
PB
29082004-05-23 Paolo Bonzini <bonzini@gnu.org>
2909
2910 Moved libcpp from the gcc subdirectory to the toplevel.
2911 * Makefile.am: New file.
2912 * Makefile.in: Regenerate.
2913 * configure.ac: New file.
2914 * configure: Regenerate.
2915 * config.in: Regenerate.
2916 * charset.c: Moved from gcc/cppcharset.c. Add note about
2917 brokenness of input charset detection. Adjust for change
2918 in name of cppucnid.h.
2919 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
2920 * expr.c: Moved from gcc/cppexp.c.
2921 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
2922 Remove #define of O_BINARY, it is in system.h.
2923 * identifiers.c: Moved from gcc/cpphash.c.
2924 * internal.h: Moved from gcc/cpphash.h. Change header
2925 guard name. All other files adjusted to match name change.
2926 * init.c: Moved from gcc/cppinit.c.
2927 (init_library) [ENABLE_NLS]: Call bindtextdomain.
2928 * lex.c: Moved from gcc/cpplex.c.
2929 * directives.c: Moved from gcc/cpplib.c.
2930 * macro.c: Moved from gcc/cppmacro.c.
2931 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
2932 * traditional.c: Moved from gcc/cpptrad.c.
2933 * ucnid.h: Moved from gcc/cppucnid.h. Change header
2934 guard name.
2935 * ucnid.pl: Moved from gcc/cppucnid.pl.
2936 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
2937 guard name.
2938 * symtab.c: Moved from gcc/hashtable.c.
2939 * line-map.c: Moved from gcc. Do not include intl.h.
2940 * mkdeps.c: Moved from gcc.
2941 * system.h: New file.
2cf22451
ZW
2942 * include/cpplib.h: Moved from gcc. Change header guard name.
2943 * include/line-map.h: Moved from gcc. Change header guard name.
2944 * include/mkdeps.h: Moved from gcc. Change header guard name.
2945 * include/symtab.h: Moved from gcc/hashtable.h. Change header
2946 guard name.