1 2013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
4 * configure.ac: Require 64-bit int for arm*-*-rtems*.
5 * configure: Regenerate.
7 2012-09-20 Release Manager
11 2012-06-14 Release Manager
15 2012-03-22 Release Manager
19 2012-02-14 Walter Lee <walt@tilera.com>
21 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
22 * configure: Regenerate.
24 2012-01-09 Richard Guenther <rguenther@suse.de>
26 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
28 2012-01-09 Gary Funck <gary@intrepid.com>
31 * files.c (_cpp_get_file_name): New. Implement file name
33 * internal.h (_cpp_get_file_name): New prototype.
34 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
35 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
37 2012-01-03 Olivier Hainque <hainque@adacore.com>
39 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
41 2011-12-20 Joseph Myers <joseph@codesourcery.com>
43 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
44 (CLK_STDC1X): Change to CLK_STDC11.
45 * init.c (lang_defaults): Update comments.
46 (cpp_init_builtins): Update language tests. Use 201112L for C11
49 2011-12-20 Andreas Schwab <schwab@linux-m68k.org>
51 * configure: Regenerate.
53 2011-12-19 Andreas Schwab <schwab@linux-m68k.org>
55 * configure: Regenerate.
57 2011-12-07 Jakub Jelinek <jakub@redhat.com>
60 * internal.h (_cpp_init_lexer): New prototype.
61 * init.c (init_library): Call it.
62 * lex.c (init_vectorized_lexer): Remove constructor attribute,
64 (HAVE_init_vectorized_lexer): Define.
65 (_cpp_init_lexer): New function.
67 2011-12-03 Dodji Seketeli <dodji@redhat.com>
69 * macro.c (tokens_buff_remove_last_token)
70 (tokens_buff_put_token_to): Add an 'inline' function specifier to
73 2011-11-22 Diego Novillo <dnovillo@google.com>
75 * include/line-map.h (linemap_dump): Declare.
76 (line_table_dump): Declare.
77 * line-map.c (linemap_dump): New.
78 (line_table_dump): New.
80 2011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
83 * expr.c (cpp_userdef_char_remove_type): Fix typo.
85 2011-11-03 Michael Matz <matz@suse.de>
88 * configure.ac: Check for -fno-exceptions -fno-rtti.
89 * configure: Regenerate.
90 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
91 (ALL_CXXFLAGS): Use it.
93 2011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
95 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
97 2011-11-02 Jason Merrill <jason@redhat.com>
100 * configure.ac: Add -Wno-narrowing to warning options.
102 2011-10-31 Jason Merrill <jason@redhat.com>
105 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
108 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
109 CLK_GNUCXX0X to CLK_GNUCXX11.
111 2011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
113 Implement C++11 user-defined literals.
114 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
115 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
116 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
117 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
118 (cpp_classify_number): Classify unrecognized tokens as user-defined
120 * include/cpplib.h: Add new tokens for user-defined literals.
121 * init.c: Add new preprocessor flag (cxx11).
122 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
123 including concatenation and promotion with suffixes.
125 2011-10-24 Dodji Seketeli <dodji@redhat.com>
127 * line-map.c (linemap_macro_map_lookup): Fix logic.
129 2011-10-24 Dodji Seketeli <dodji@redhat.com>
131 * include/line-map.h (linemap_expand_location): Take a line table
132 parameter. Update comment.
133 (linemap_resolve_location): Update comment.
134 (linemap_expand_location_full): Remove.
135 * line-map.c (linemap_resolve_location): Handle reserved
136 locations; return a NULL map in those cases.
137 (linemap_expand_location): If location is reserved, return a
138 zeroed expanded location. Update comment. Take a line table to
139 assert that the function takes non-virtual locations only.
140 (linemap_expand_location_full): remove.
141 (linemap_dump_location): Handle the fact that
142 linemap_resolve_location can return NULL line maps when the
143 location resolves to a reserved location.
145 * line-map.c (linemap_macro_map_lookup): Fix logic.
147 2011-10-22 Dodji Seketeli <dodji@redhat.com>
150 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
152 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
154 (cpp_token_from_context_at): Likewise.
155 (cpp_peek_token): Use the context to peek tokens from.
157 2011-10-20 Dodji Seketeli <dodji@redhat.com>
160 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
163 2011-10-18 Dodji Seketeli <dodji@redhat.com>
166 * include/line-map.h (struct linemap_stats): Change the type of
167 the members from size_t to long.
168 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
171 2011-10-17 Dodji Seketeli <dodji@redhat.com>
173 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
174 variable without using it if ENABLE_CHECKING is not defined. Mark
175 the LOCATION parameter as being unused.
177 2011-10-15 Tom Tromey <tromey@redhat.com>
178 Dodji Seketeli <dodji@redhat.com>
180 * include/line-map.h (struct line_maps::alloced_size_for_request):
182 * line-map.c (new_linemap): Use set->alloced_size_for_request to
183 get the actual allocated size of line maps.
185 2011-10-15 Tom Tromey <tromey@redhat.com>
186 Dodji Seketeli <dodji@redhat.com>
188 * line-map.h (struct linemap_stats): Declare new struct.
189 (linemap_get_statistics): Declare ...
190 * line-map.c (linemap_get_statistics): ... new function.
191 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
192 Declare new counters.
193 (enter_macro_context, replace_args): Update
194 num_macro_tokens_counter.
195 (cpp_get_token_1): Update num_expanded_macros_counter.
197 2011-10-15 Tom Tromey <tromey@redhat.com>
198 Dodji Seketeli <dodji@redhat.com>
200 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
201 * include/line-map.h (linemap_dump_location): Declare ...
202 * line-map.c (linemap_dump_location): ... new function.
204 2011-10-15 Tom Tromey <tromey@redhat.com>
205 Dodji Seketeli <dodji@redhat.com>
207 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
209 * internal.h (struct macro_context): New struct.
210 (enum context_tokens_kind): New enum.
211 (struct cpp_context)<tokens_kind>: New member of type enum
213 (struct cpp_context)<macro>: Remove this. Replace it with an enum
214 of macro and macro_context.
215 (struct cpp_context)<direct_p>: Remove.
216 (_cpp_remaining_tokens_num_in_context): Declare new function.
217 * directives.c (destringize_and_run): Adjust.
218 * lex.c (_cpp_remaining_tokens_num_in_context)
219 (_cpp_token_from_context_at): Define new functions
220 (cpp_peek_token): Use them.
221 * init.c (cpp_create_reader): Initialize the base context to zero.
222 (_cpp_token_from_context_at): Define new static function.
223 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
224 _cpp_token_from_context_at.
225 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
227 (enum macro_arg_token_kind): New enum.
228 (struct macro_arg_token_iter): New struct.
229 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
230 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
231 (delete_macro_args, set_arg_token, get_arg_token_location)
232 (arg_token_ptr_at, macro_arg_token_iter_init)
233 (macro_arg_token_iter_get_token)
234 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
235 (expanded_token_index, tokens_buff_new, tokens_buff_count)
236 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
237 (tokens_buff_add_token, tokens_buff_remove_last_token)
238 (reached_end_of_context, consume_next_token_from_context): New
240 (cpp_get_token_1): New static function. Split and extended from
241 cpp_get_token. Use reached_end_of_context and
242 consume_next_token_from_context. Unify its return point. Move
243 the location tweaking from cpp_get_token_with_location in here.
244 (cpp_get_token): Use cpp_get_token_1
245 (stringify_arg): Use the new arg_token_at.
246 (paste_all_tokens): Support tokens coming from extended tokens
248 (collect_args): Return the number of collected arguments, by
249 parameter. Store virtual locations of tokens that constitute the
251 (funlike_invocation_p): Return the number of collected arguments,
253 (enter_macro_context): Add a parameter for macro expansion point.
254 Pass it to replace_args and to the "used" cpp callback. Get the
255 number of function-like macro arguments from funlike_invocation_p,
256 pass it to the new delete_macro_args to free the memory used by
257 macro args. When -ftrack-macro-expansion is in effect, for macros
258 that have no arguments, create a macro map for the macro expansion
259 and use it to allocate proper virtual locations for tokens
260 resulting from the expansion. Push an extended tokens context
261 containing the tokens resulting from macro expansion and their
263 (replace_args): Rename the different variables named 'count' into
264 variables with more meaningful names. Create a macro map;
265 allocate virtual locations of tokens resulting from this
266 expansion. Use macro_arg_token_iter to iterate over tokens of a
267 given macro. Handle the case of the argument of
268 -ftrack-macro-expansion being < 2. Don't free macro arguments
269 memory resulting from expand_arg here, as these are freed by the
270 caller of replace_arg using delete_macro_args now. Push extended
272 (next_context, push_ptoken_context, _cpp_push_token_context)
273 (_cpp_push_text_context): Properly initialize the context.
274 (expand_arg): Use the new alloc_expanded_arg_mem,
275 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
276 (_cpp_pop_context): Really free the memory held by the context.
277 Handle freeing memory used by extended tokens contexts.
278 (cpp_get_token_with_location): Use cpp_get_token_1.
279 (cpp_sys_macro_p): Adjust.
280 (_cpp_backup_tokens): Support the new kinds of token contexts.
281 * traditional.c (recursive_macro): Adjust.
283 2011-10-15 Tom Tromey <tromey@redhat>
284 Dodji Seketeli <dodji@redhat.com>
286 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
288 (MAX_SOURCE_LOCATION): New constant.
289 (struct line_map_ordinary, struct line_map_macro): New structs.
290 (struct line_map): Turn this into a union of the two above. Add
292 (struct maps_info): New struct.
293 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
294 These now carry the map information that was previously scattered
296 (struct map_info::allocated): Fix comment.
297 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
298 (ORDINARY_MAP_STARTING_LINE_NUMBER)
299 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
300 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
301 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
302 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
303 (MACRO_MAP_EXPANSION_POINT_LOCATION)
304 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
305 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
306 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
307 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
308 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
309 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
310 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
311 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
312 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
313 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
314 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
316 (linemap_check_ordinary, linemap_assert)
317 (linemap_location_before_p): New macros.
318 (linemap_position_for_line_and_column)
319 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
320 (linemap_macro_expansion_map_p)
321 (linemap_macro_map_loc_to_def_point)
322 (linemap_macro_map_loc_unwind_once)
323 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
324 (linemap_get_source_line linemap_get_source_column)
325 (linemap_map_get_macro_name, linemap_get_file_path)
326 (linemap_location_in_system_header_p)
327 (linemap_location_from_macro_expansion_p): Declare new functions.
328 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
329 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
330 accessors act on ordinary maps only.
331 (INCLUDED_FROM): Return NULL for main files; use the new
333 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
334 (struct expanded_location): Move here from gcc/input.h
335 (linemap_resolve_location, linemap_expand_location)
336 (linemap_expand_location_full): Declare new functions.
337 * line-map.c: Include cpplib.h, internal.h
338 (linemap_enter_macro, linemap_add_macro_token)
339 (linemap_get_expansion_line, linemap_get_expansion_filename): New
340 functions that are private to libcpp.
341 (linemap_assert): New macro.
342 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
343 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
344 (linemap_macro_map_loc_unwind_toward_spelling)
345 (linemap_macro_map_loc_to_exp_point)
346 (first_map_in_common_1, first_map_in_common): New static
348 (new_linemap): Define new static functions. Extracted and
350 (linemap_add): ... here. Use linemap_assert in lieu of abort
352 (linemap_tracks_macro_expansion_locs_p)
353 (linemap_add_macro_token, linemap_macro_expansion_map_p)
354 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
355 (linemap_macro_map_loc_to_def_point)
356 (linemap_macro_map_loc_unwind_once)
357 (linemap_step_out_once, linemap_map_get_index)
358 (linemap_get_source_line,linemap_get_source_column)
359 (linemap_get_file_path, linemap_map_get_macro_name)
360 (linemap_location_in_system_header_p)
361 (linemap_location_originated_from_system_header_p)
362 (linemap_location_from_macro_expansion_p)
363 (linemap_tracks_macro_expansion_locs_p)
364 (linemap_resolve_location, linemap_expand_location)
365 (linemap_expand_location_full)
366 (linemap_tracks_macro_expansion_locs_p)
367 (linemap_position_for_line_and_column, linemap_compare_locations):
368 Define new public functions.
369 (linemap_init): Initialize ordinary and macro maps information in
371 (linemap_check_files_exited): Use the new accessors.
372 (linemap_free): Remove this dead code.
373 (linemap_line_start): Assert this uses an ordinary map. Adjust to
374 use the new ordinary map accessors and data structures. Don't
375 overflow past the lowest possible macro token's location.
376 (linemap_position_for_column): Assert the ordinary maps of the map
377 set are really ordinary. Use ordinary map accessors.
378 (linemap_lookup): Keep the same logic but generalize to allow
379 lookup of both ordinary and macro maps. Do not crash when called
380 with an empty line table.
381 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
382 new API of line-map.h.
383 * directives.c (start_directive, do_line, do_linemarker)
384 (do_linemarker): Likewise.
385 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
386 (make_cpp_dir, cpp_make_system_header): Likewise.
387 * init.c (cpp_read_main_file): Likewise.
388 * internal.h (CPP_INCREMENT_LINE): Likewise.
389 (linemap_enter_macro, linemap_add_macro_token)
390 (linemap_get_expansion_line, linemap_get_expansion_filename): New
391 functions private to libcpp.
392 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
393 (skip_line_comment, skip_whitespace, lex_raw_string)
394 (_cpp_lex_direct): Likewise.
395 * macro.c (_cpp_builtin_macro_text): Likewise.
396 (_cpp_aligned_alloc): Initialize the new name member of the macro.
397 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
399 * errors.c (cpp_diagnostic): Adjust to new linemap API.
401 2011-08-28 Dodji Seketeli <dodji@redhat.com>
403 * line-map.c (linemap_add): Assert that reason must not be
404 LC_RENAME when called for the first time on a "main input file".
406 2011-08-22 Gabriel Charette <gchare@google.com>
408 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
409 * internal.h (struct cpp_reader): Add field forced_token_location_p.
410 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
411 (cpp_force_token_locations): New.
412 (cpp_stop_forcing_token_locations): New.
414 2011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
417 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
419 2011-08-18 Joseph Myers <joseph@codesourcery.com>
421 * include/cpplib.h (struct cpp_options): Fix typo.
423 2011-08-18 Joseph Myers <joseph@codesourcery.com>
425 * include/cpplib.h (struct cpp_options): Add rliterals.
426 * init.c (struct lang_flags, lang_defaults): Add rliterals.
427 (cpp_set_lang): Set rliterals option.
428 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
429 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
431 2011-08-15 Gabriel Charette <gchare@google.com>
433 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
434 Update all users to use linemap_position_for_column instead.
436 2011-07-28 Gabriel Charette <gchare@google.com>
438 * include/line-map.h (struct line_maps):
439 Remove unused field last_listed. Update all users.
441 2011-07-28 H.J. Lu <hongjiu.lu@intel.com>
443 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
444 * configure: Regenerated.
446 2011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
448 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
450 2011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
451 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
454 * configure.ac: Test AM_ICONV with CXX.
455 * configure: Regenerate.
456 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
458 2011-07-15 Dodji Seketeli <dodji@redhat.com>
460 * directives.c (struct if_stack): Use source_location as type
462 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
463 indent, def_pragma, used_define, used_undef>: Properly use
464 source_location as parameter type, rather than unsigned int.
466 2011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
469 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
470 like i[34567]86-*-solaris2.1[0-9]*.
471 * configure: Regenerate.
473 2011-06-16 Jason Merrill <jason@redhat.com>
476 * lex.c (lex_raw_string): Don't check for embedded NUL.
478 2011-06-06 Dodji Seketeli <dodji@redhat.com>
480 PR preprocessor/48532
481 * directives.c (do_pragma): Don't forget the invocation location
482 when parsing the pragma name of a namespaced pragma directive.
484 2011-05-29 John Tytgat <John.Tytgat@aaug.net>
486 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
488 2011-05-22 Uros Bizjak <ubizjak@gmail.com>
491 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
492 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
494 2011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
496 * system.h (ENUM_BITFIELD): Remove.
498 2011-04-24 Jakub Jelinek <jakub@redhat.com>
500 PR preprocessor/48740
501 * lex.c (lex_raw_string): When raw string ends with
502 ??) followed by raw prefix and ", ensure it is preprocessed
503 with ??) rather than ??].
505 2011-04-20 Jim Meyering <meyering@redhat.com>
507 * files.c (destroy_cpp_file): Remove useless if-before-free.
508 * init.c (cpp_destroy): Likewise.
509 * macro.c (replace_args): Likewise.
510 * pch.c (cpp_valid_state): Likewise.
512 2011-03-25 Kai Tietz <ktietz@redhat.com>
514 * files.c (file_hash_eq): Use filename_cmp
516 (nonexistent_file_hash_eq): Likewise.
517 (remap_filename): Likewise.
518 Handle absolute DOS-path,
519 (append_file_to_dir): Check for IS_DIR_SEPARATOR
521 (read_name_map): Likewise.
522 * linemap.c (linemap_add): Use filename_cmp
524 * mkdeps.c (apply_vpath): Use filename_ncmp
526 (deps_restore): Use filename_cmp instead of
528 * init.c (read_original_directory): Use
529 IS_DIR_SEPARATOR instead of checking for slash.
531 2011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
533 PR preprocessor/48192
534 * directives.c (do_ifdef): Do not consider conditional macros as
537 * expr.c (parse_defined): Ditto.
539 2011-03-18 Richard Henderson <rth@redhat.com>
542 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
544 2011-11-04 Eric Botcazou <ebotcazou@adacore.com>
545 Jakub Jelinek <jakub@redhat.com>
547 PR preprocessor/39213
548 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
549 pragmas as well in traditional mode.
551 2010-11-17 Ian Lance Taylor <iant@google.com>
554 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
555 AC_LANG based on ENABLE_BUILD_WITH_CXX.
557 2010-11-16 Kai Tietz <kai.tietz@onevision.com>
559 PR preprocessor/17349
560 * lex.c (save_comment): Handle in argument passing c++
563 2010-11-02 Ian Lance Taylor <iant@google.com>
565 * configure.ac: Use AC_SYS_LARGEFILE.
566 * configure: Rebuild.
567 * config.in: Rebuild.
569 2010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
571 * line-map.h (source_location): Remove obsolete comment
572 mentioning location_s.
574 2010-09-29 Kai Tietz <kai.tietz@onevision.com>
576 PR preprocessor/45362
577 * directives.c (cpp_pop_definition): Make static.
578 (do_pragma_push_macro): Reworked to store text
580 (do_pragma_pop_macro): Add free text definition.
581 (cpp_push_definition): Removed.
582 * include/cpplib.h (cpp_push_definition): Removed.
583 (cpp_pop_definition): Likewise.
584 * internal.h (def_pragma_macro): Remove member 'value'
585 and add new members 'definition', 'line',
586 'syshdr', 'sued' and 'is_undef'.
587 * pch.c (_cpp_restore_pushed_macros): Rework to work
588 on text definition and store additional macro flags.
589 (_cpp_save_pushed_macros): Likewise.
591 2010-09-29 Joseph Myers <joseph@codesourcery.com>
593 * include/cpplib.h (cpp_options): Rename warn_deprecated,
594 warn_traditional, warn_long_long and pedantic.
595 * directives.c (directive_diagnostics, _cpp_handle_directive):
596 Update names of cpp_options members.
597 * expr.c (cpp_classify_number, eval_token): Update names of
599 * init.c (cpp_create_reader, post_options): Update names of
601 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
603 * macro.c (parse_params): Update names of cpp_options members.
605 2010-09-15 Ian Lance Taylor <iant@google.com>
607 * init.c: Fix type name in comment.
609 2010-08-31 Jakub Jelinek <jakub@redhat.com>
611 PR preprocessor/45457
612 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
614 * directives.c (do_ifdef, do_ifndef): Likewise.
616 2010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
618 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
620 2010-08-24 Richard Henderson <rth@redhat.com>
623 * configure.ac (HAVE_SSE4): New check.
624 * configure, config.in: Rebuild.
625 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
627 2010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
629 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
630 etc. on Solaris 2/x86.
632 2010-08-21 Richard Henderson <rth@redhat.com>
633 Andi Kleen <ak@linux.intel.com>
634 David S. Miller <davem@davemloft.net>
636 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
637 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
638 (ptrdiff_t): Check via AC_CHECK_TYPE.
639 * config.in, configure: Rebuild.
640 * system.h: Include stdint.h, if available.
641 * lex.c (WORDS_BIGENDIAN): Provide default.
642 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
643 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
644 search_line_sse2, search_line_sse42, init_vectorized_lexer,
645 search_line_fast): New.
646 (_cpp_clean_line): Use search_line_fast. Restructure the fast
647 loop to make it clear when we're leaving the loop. Stay in the
648 fast loop for non-trigraph '?'.
650 2010-06-11 Jakub Jelinek <jakub@redhat.com>
652 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
654 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
655 (cpp_macro_definition): Remove const qual from second argument.
656 * macro.c (enter_macro_context): Call user_builtin_macro callback for
657 NODE_BUILTIN !NODE_USED macros.
658 (warn_of_redefinition): Likewise. Remove const qual from second
660 (cpp_macro_definition): Likewise.
661 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
662 for NODE_BUILTIN !NODE_USED macros.
664 2010-06-10 Joseph Myers <joseph@codesourcery.com>
666 * include/cpplib.h (struct cpp_options): Remove show_column.
667 * init.c (cpp_create_reader, post_options): Don't set show_column.
669 2010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
672 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
673 check that C++ compiler works.
674 * configure: Regenerate.
676 2010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
678 * include/symtab.h (ht_identifier_ptr): New.
680 2010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
681 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
684 * configure.ac: Check for declaration of 'basename(char *)'.
685 * configure: Regenerate.
686 * config.in: Regenerate.
688 2010-04-25 Joseph Myers <joseph@codesourcery.com>
690 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
691 * init.c (lang_defaults): Add entries for new language variants.
692 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
695 2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
698 * files.c (report_missing_guard): Test for #pragma once.
700 2010-04-07 Simon Baldwin <simonb@google.com>
702 * directives.c (do_diagnostic): Add warning reason argument,
703 call appropriate error reporting function for code.
704 (directive_diagnostics): Call specific warning functions with
705 warning reason where appropriate.
706 (do_error, do_warning, do_pragma_dependency): Add warning reason
707 argument to do_diagnostic calls.
708 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
709 _cpp_create_definition): Call specific warning functions with
710 warning reason where appropriate.
711 * Makefile.in: Add new diagnostic functions to gettext translations.
712 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
714 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
715 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
716 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
717 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
718 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
719 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
720 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
721 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
722 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
723 warning reason codes.
724 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
725 cpp_warning_with_line, cpp_pedwarning_with_line,
726 cpp_warning_with_line_syshdr): New specific error reporting functions.
727 * pch.c (cpp_valid_state): Call specific warning functions with
728 warning reason where appropriate.
729 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
731 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
732 cpp_warning_with_line, cpp_pedwarning_with_line,
733 cpp_warning_with_line_syshdr): New specific error reporting functions.
734 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
735 specific warning functions with warning reason where appropriate.
736 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
737 warn_about_normalization, lex_identifier_intern, lex_identifier,
738 _cpp_lex_direct): Ditto.
739 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
740 narrow_str_to_charconst): Ditto.
742 2010-04-06 Jakub Jelinek <jakub@redhat.com>
744 PR preprocessor/43642
745 * lex.c (lex_raw_string): Change type of TYPE variable to
748 2010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
750 * aclocal.m4: Regenerate.
752 2010-03-29 Jason Merrill <jason@redhat.com>
754 More N3077 raw string changes
755 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
757 * lex.c (bufring_append): Split out from...
758 (lex_raw_string): ...here. Undo trigraph and line splicing
759 transformations. Do process line notes in multi-line literals.
760 (_cpp_process_line_notes): Ignore notes that were already handled.
762 Some raw string changes from N3077
763 * charset.c (cpp_interpret_string): Change inner delimiters to ().
764 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
766 2010-02-11 Jakub Jelinek <jakub@redhat.com>
768 * init.c (read_original_filename): Don't call read_original_directory
769 if _cpp_handle_directive returns 0.
771 2010-01-01 Joseph Myers <joseph@codesourcery.com>
773 PR preprocessor/41947
774 * expr.c (cpp_classify_number): Give error for hexadecimal
775 floating-point constant with no digits before or after point.
777 2009-11-20 Arnaud Charlet <charlet@adacore.com>
779 * macro.c (enter_macro_context): Call cb.used callback if defined.
780 * directives.c (do_idef, do_ifndef): Ditto.
781 * include/cpplib.h (struct cpp_callbacks): Add used callback.
783 2009-11-11 Kai Tietz <kai.tietz@onevision.com>
785 * directives.c (do_pragma_push_macro): New pragma handler.
786 (do_pragma_pop_macro): Likewise.
787 (_cpp_init_internal_pragmas): Add push_macro and
788 pop_macro handler to internal pragmas.
789 (lex_macro_node_from_str): Removed.
790 (cpp_push_definition): Replace lex_macro_node_from_str
791 by _cpp_lex_identifier.
792 (cpp_pop_definition): Likewise.
793 * internal.h (_cpp_lex_identifier): New prototype.
794 (def_pragma_macro): New structure.
795 (cpp_reader): New member pushed_macros.
796 * lex.c (_cpp_lex_identifier): New function.
797 (lex_identifier_intern): New function.
798 * init.c (cpp_create_reader): Initialize pushed_macros
800 (cpp_destroy): Free elements in pushed_macros member.
801 * pch.c (_cpp_save_pushed_macros): New function.
802 (_cpp_restore_pushed_macros): Likewise.
803 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
804 (cpp_read_state): Use _cpp_restore_pushed_macros.
806 2009-10-19 Jakub Jelinek <jakub@redhat.com>
808 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
809 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
810 and char32_cset_desc.
811 (converter_for_type): Handle CPP_UTF8STRING.
812 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
813 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
814 (parse_include): Reject raw strings.
815 * include/cpplib.h (CPP_UTF8STRING): New token type.
816 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
817 * lex.c (lex_raw_string): New function.
818 (lex_string): Handle u8 string literals, call lex_raw_string
819 for raw string literals.
820 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
822 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
824 2009-10-14 Jakub Jelinek <jakub@redhat.com>
826 PR preprocessor/41543
827 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
828 * line-map.c (linemap_init): Initialize highest_location and
829 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
831 2009-10-09 Jason Merrill <jason@redhat.com>
833 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
835 2009-10-09 Neil Vachharajani <nvachhar@google.com>
837 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
840 2009-09-23 Loren J. Rittle <ljrittle@acm.org>
842 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
843 * configure: Rebuilt.
845 2009-09-22 Richard Guenther <rguenther@suse.de>
848 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
850 2009-09-18 Chris Demetriou <cgd@google.com>
852 PR preprocessor/28435:
853 * include/cpplib.h (struct cpp_options): Add new member
854 deps.need_preprocessor_output.
855 * files.c (open_file_failed): If preprocessor output is needed
856 always report an error.
858 2009-09-13 Kai Tietz <kai.tietz@onevision.com>
860 * configure.ac: Set for i?86-w64-mingw*
861 need_64bit_hwint to yes.
862 * configure: Regenerated.
864 2009-09-10 Jason Merrill <jason@redhat.com>
866 * directives.c (cpp_define): constify.
868 2009-09-02 Ian Lance Taylor <iant@google.com>
870 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
872 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
874 * configure.ac (AC_PREREQ): Bump to 2.64.
876 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
878 * aclocal.m4: Regenerate.
879 * config.in: Regenerate.
880 * configure: Regenerate.
882 2009-08-17 Tom Tromey <tromey@redhat.com>
884 PR preprocessor/41067:
885 * charset.c (convert_escape): Add missing ":" to error text.
887 2009-07-27 Douglas B Rupp <rupp@gnat.com>
889 * include/cpplib.h (INO_T_CPP): New macro.
890 (struct cpp_dir): Use it.
892 2009-07-20 Jerry Quinn <jlquinn@optonline.net>
895 * configure.ac: Use = instead of == for testing
896 ENABLE_BUILD_WITH_CXX.
897 * configure: Rebuild.
899 2009-07-17 Jerry Quinn <jlquinn@optonline.net>
901 * directives.c (do_linemarker, do_line): Use CPP_STRING for
903 * files.c (find_file_in_dir): Add cast from void* to char*.
904 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
905 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
907 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
908 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
909 COMPILER_FLAGS): New.
910 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
911 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
912 instead of ALL_CFLAGS.
913 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
914 from other warnings. Add -Wc++-compat to C-specific warnings.
915 Check for --enable-build-with-cxx. Set and substitute
916 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
917 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
919 * configure: Rebuild.
920 * include/cpp-id-data.h: Remove extern "C".
921 * include/line-map.h: Likewise.
922 * include/mkdeps.h: Likewise.
923 * include/symtab.h: Likewise.
924 * internal.h: Likewise.
926 2009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
928 * directives.c (parse_include): Add location argument. Update all
930 (parse_answer): Likewise.
931 (do_include_common): Error with exact location.
932 (parse_assertion): Likewise.
934 2009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
936 * expr.c (num_div_op): Take explicit location.
938 2009-06-17 Ian Lance Taylor <iant@google.com>
940 * include/cpplib.h (progname): Don't declare.
942 2009-06-12 Ian Lance Taylor <iant@google.com>
944 * include/cpplib.h (struct cpp_options): Add
945 warn_cxx_operator_names field.
946 (NODE_WARN_OPERATOR): Define.
947 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
949 * init.c (mark_named_operators): Add flags parameter.
950 (cpp_post_options): Pick flags value to pass to
951 mark_named_operators.
952 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
953 identifier is an operator name in C++.
955 2009-06-01 Aldy Hernandez <aldyh@redhat.com>
957 * include/line-map.h (LAST_SOURCE_COLUMN): New.
959 2009-06-01 Ian Lance Taylor <iant@google.com>
961 * include/cpp-id-data.h: Add extern "C".
962 * include/line-map.h: Likewise.
963 * include/mkdeps.h: Likewise.
964 * include/symtab.h: Likewise.
965 * internal.h: Likewise.
967 2009-05-15 Ian Lance Taylor <iant@google.com>
969 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
970 builtin_type. Change all uses.
972 2009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
975 * directives (do_linemarker): Compensate for the increment in
976 location that occurs when we reach the end of line.
977 * files (_cpp_stack_include): Mention _cpp_find_file in the
980 2009-05-10 Joseph Myers <joseph@codesourcery.com>
982 * include/cpplib.h (enum cpp_token_fld_kind): Add
983 CPP_TOKEN_FLD_TOKEN_NO.
984 (struct cpp_macro_arg, struct cpp_identifier): Define.
985 (union cpp_token_u): Use struct cpp_identifier for identifiers.
986 Use struct cpp_macro_arg for macro arguments. Add token_no for
987 CPP_PASTE token numbers.
988 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
989 do_pragma_poison, parse_assertion): Use val.node.node in place of
991 * expr.c (parse_defined, eval_token): Use val.node.node in place
993 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
994 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
995 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
996 place of val.arg_no. Use val.node.node in place of val.node.
997 * macro.c (replace_args, cpp_get_token, parse_params,
998 lex_expansion_token, create_iso_definition, cpp_macro_definition):
999 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
1000 Use val.node.node in place of val.node.
1002 2009-05-03 Joseph Myers <joseph@codesourcery.com>
1004 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
1007 2009-04-25 Joseph Myers <joseph@codesourcery.com>
1009 PR preprocessor/39559
1010 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
1011 constants larger than intmax_t in C99 mode.
1013 2009-04-21 Taras Glek <tglek@mozilla.com>
1015 * include/cpp-id-data.h: Update GTY annotations to new syntax.
1016 * include/cpplib.h: Likewise.
1017 * include/line-map.h: Likewise.
1018 * include/symtab.h: Likewise.
1020 2009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1023 * lex.c (cpp_type2name): Take a flags parameter. Call
1024 cpp_named_operator2name for named operators and cpp_digraph2name
1026 (cpp_digraph2name): New.
1027 (cpp_spell_token): Use it.
1028 (cpp_output_token): Likewise.
1029 * include/cpplib.h (cpp_type2name): Update declaration.
1030 * init.c (cpp_named_operator2name): New.
1031 * internal.h (cpp_named_operator2name): Declare.
1033 2009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1036 * init.c (cpp_create_reader): Wlong_long is disabled by default.
1037 * expr.c (cpp_classify_number): Give different messages for C and
1040 2009-04-19 Joseph Myers <joseph@codesourcery.com>
1042 PR preprocessor/20078
1043 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
1045 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
1046 (struct cpp_token): Change flags to unsigned short.
1047 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
1048 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
1049 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
1051 * macro.c (macro_real_token_count): New.
1052 (enter_macro_context, replace_args): Use macro_real_token_count.
1053 (create_iso_definition): Record whitespace surrounding and digraph
1054 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
1055 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
1056 multiple consecutive ## tokens.
1057 (_cpp_create_definition): Initialize extra_tokens.
1058 (cpp_macro_definition): Use macro_real_token_count.
1060 2009-04-18 Joseph Myers <joseph@codesourcery.com>
1062 * directives.c (parse_include): Pass true to check_eol.
1064 2009-04-18 Joseph Myers <joseph@codesourcery.com>
1066 PR preprocessor/39646
1067 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
1068 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
1069 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
1072 2009-04-18 Joseph Myers <joseph@codesourcery.com>
1074 PR preprocessor/39647
1075 * directives.c (check_eol): Add parameter expand.
1076 (do_undef, parse_include, do_line, do_linemarker, do_ident,
1077 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
1078 do_else, do_endif, do_assert, do_unassert): All callers changed.
1079 Pass true from do_line, false elsewhere.
1081 2009-04-12 Joseph Myers <joseph@codesourcery.com>
1083 PR preprocessor/31869
1084 * macro.c (stringify_arg): Handle NULL source token in padding
1085 token where previous padding token did not have source token with
1086 preceding whitespace.
1088 2009-04-09 Jakub Jelinek <jakub@redhat.com>
1090 * Makefile.in: Change copyright header to refer to version
1091 3 of the GNU General Public License and to point readers at the
1092 COPYING3 file and the FSF's license web page.
1093 * charset.c: Likewise.
1094 * directives-only.c: Likewise.
1095 * directives.c: Likewise.
1096 * errors.c: Likewise.
1098 * files.c: Likewise.
1099 * identifiers.c: Likewise.
1100 * include/cpp-id-data.h: Likewise.
1101 * include/cpplib.h: Likewise.
1102 * include/line-map.h: Likewise.
1103 * include/mkdeps.h: Likewise.
1104 * include/symtab.h: Likewise.
1106 * internal.h: Likewise.
1108 * line-map.c: Likewise.
1109 * macro.c: Likewise.
1110 * makeucnid.c: Likewise.
1111 * mkdeps.c: Likewise.
1113 * symtab.c: Likewise.
1114 * system.h: Likewise.
1115 * traditional.c: Likewise.
1116 * ucnid.tab: Likewise.
1117 * ucnid.h: Regenerate.
1119 2009-04-01 Janis Johnson <janis187@us.ibm.com>
1122 * include/cpplib.h (CPP_N_DEFAULT): Define.
1123 * expr.c (interpret_float_suffix): Recognize d or D for double,
1124 return new value for default.
1125 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
1128 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
1129 letters from decimal float and fixed-point suffixes.
1131 2009-03-31 Joseph Myers <joseph@codesourcery.com>
1133 PR preprocessor/15638
1134 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
1136 (open_file_failed): Make error for missing file fatal.
1137 * include/cpplib.h (CPP_DL_FATAL): Define.
1139 2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
1141 PR preprocessor/31932:
1142 * internal.h: Don't mention HAVE_ICONV_H.
1143 * configure, config.in: Rebuild.
1144 * configure.ac: Don't check for iconv.h.
1146 2009-03-30 Tom Tromey <tromey@redhat.com>
1148 PR preprocessor/39512:
1149 * line-map.c (linemap_init): Initialize 'reallocator' field.
1151 2009-03-30 Jakub Jelinek <jakub@redhat.com>
1154 * macro.c (cpp_get_token): If macro_to_expand returns NULL
1155 and used some tokens, add CPP_PADDING before next token.
1157 2009-03-29 Joseph Myers <joseph@codesourcery.com>
1159 PR preprocessor/34695
1160 * makedepend.c: Remove.
1161 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
1162 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
1163 * directives.c (cpp_errors): Remove.
1164 * errors.c (print_location, _cpp_begin_message, v_message):
1166 (cpp_error, cpp_error_with_line): Always use error callback.
1167 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
1168 * include/cpplib.h (cpp_options): Remove pedantic_errors,
1169 inhibit_warnings, warn_system_headers, inhibit_errors,
1170 warnings_are_errors, client_diagnostic.
1171 (cpp_callbacks): Add extra arguments to error callback; make it
1173 (cpp_finish): Return void.
1174 (cpp_destroy): Remove inaccurate comment about return value.
1175 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
1176 (CPP_DL_NOTE): Define.
1177 * include/line-map.h (linemap_print_containing_files): Remove.
1178 * init.c (cpp_finish): Do not check for or return number of
1180 * internal.h (cpp_reader): Remove errors field.
1181 * line-map.c (linemap_print_containing_files): Remove.
1182 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
1183 about previous definition. Only emit it if previous diagnostic
1186 2009-03-28 Joseph Myers <joseph@codesourcery.com>
1188 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
1191 2009-03-18 Jakub Jelinek <jakub@redhat.com>
1193 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
1195 2009-02-21 Joseph Myers <joseph@codesourcery.com>
1197 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
1199 (_cpp_lex_direct): Handle this.
1201 2009-02-15 Richard Guenther <rguenther@suse.de>
1205 2009-02-13 Richard Guenther <rguenther@suse.de>
1207 * configure.ac: Enable LFS.
1208 * configure: Re-generate.
1209 * config.in: Likewise.
1211 2009-01-05 Ben Elliston <bje@au.ibm.com>
1213 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
1214 (.po.pox): Likewise.
1215 (po/$(PACKAGE).pot): Likewise.
1217 2008-12-10 Alexandre Oliva <aoliva@redhat.com>
1220 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
1221 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
1223 2008-11-29 Joseph Myers <joseph@codesourcery.com>
1225 * lex.c (cpp_token_len): Use 6 as default length.
1227 2008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
1229 * expr.c (struct op): Add location.
1230 (_cpp_parse_expr): Propagate locations throught the stack
1233 (check_promotion): Use explicit location in errors.
1235 2008-10-05 Matthew Gingell <gingell@adacore.com>
1236 Arnaud Charlet <charlet@adacore.com>
1238 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
1239 (cpp_get_comments): New function.
1240 * internal.h (struct cpp_reader): Add comments field.
1241 * init.c (cpp_destroy): Free comments.
1242 * lex.c (store_comment, cpp_get_comments): New functions.
1243 (comments): New struct.
1244 (save_comment): Store comments in comments struct.
1246 2008-09-18 Simon Baldwin <simonb@google.com>
1248 * include/cpplib.h (struct cpp_options): Add new boolean flag
1249 warn_builtin_macro_redefined.
1250 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
1251 * (struct builtin_operator): Split out from previous struct builtin,
1252 enhance extra const correctness.
1253 * (struct builtin_macro): Split out from previous struct builtin, add
1254 new always_warn_if_redefined flag, enhance const correctness.
1255 * (mark_named_operators): Use struct builtin_operator.
1256 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
1257 to builtins selectively.
1258 * macro.c (warn_of_redefinition): Return false if a builtin macro
1259 is not flagged with NODE_WARN.
1261 2008-07-31 Jakub Jelinek <jakub@redhat.com>
1263 PR preprocessor/36649
1264 * files.c (struct report_missing_guard_data): New type.
1265 (report_missing_guard): Put paths into an array instead of printing
1266 them right away. Return 1 rather than 0.
1267 (report_missing_guard_cmp): New function.
1268 (_cpp_report_missing_guards): Sort and print paths gathered by
1269 report_missing_guard callback.
1271 2008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1274 * directives.c (strtolinenum): Handle overflow.
1275 (do_line): Give a warning if line number overflowed.
1276 (do_linemarker): Update call to strtolinenum.
1278 2008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1280 * include/line-map.h (linenum_type): New typedef.
1281 (struct line_map): Use it.
1282 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
1283 (SOURCE_COLUMN): Likewise.
1284 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
1285 source_location values in a variable of type linenum_type.
1286 * directives.c (struct if_stack): Use linenum_type.
1287 (strtoul_for_line): Rename as strtolinenum.
1288 (do_line): Use linenum_type.
1289 (do_linemarker): Use linenum_type and strtolinenum.
1290 (_cpp_do_file_change): Use linenum_t.
1291 * line-map.c (linemap_add): Likewise.
1292 (linemap_line_start): Likewise.
1293 * traditional.c (struct fun_macro): 'line' is a source_location.
1294 * errors.c (print_location): Use linenum_type.
1295 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
1296 * internal.h (CPP_INCREMENT_LINE): Likewise.
1297 * lex.c (_cpp_skip_block_comment): Use source_location.
1299 2008-07-14 Ben Elliston <bje@au.ibm.com>
1301 * include/cpplib.h (NODE_CONDITIONAL): New.
1302 (struct cpp_callbacks): New macro_to_expand field.
1303 (struct cpp_hashnode): Adjust size of flags and type fields.
1304 (cpp_peek_token): Prototype.
1305 * lex.c (cpp_peek_token): New function.
1306 (_cpp_temp_token): Protect pre-existing lookaheads.
1307 * macro.c (cpp_get_token): Expand any conditional macros.
1308 (_cpp_backup_tokens_direct): New.
1309 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
1310 (warn_of_redefinition): Silently allow redefined conditional
1312 (_cpp_create_definition): Remove the conditional flag when a user
1313 defines one of the conditional macros.
1314 * internal.h (_cpp_backup_tokens_direct): New prototype.
1316 2008-06-13 Andrew Haley <aph@redhat.com>
1318 PR preprocessor/33305
1319 * macro.c (replace_args): Print a warning for empty macro
1320 arguments in C89 and C++.
1322 2008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1324 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
1325 * configure: Regenerate.
1327 2008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1329 * Makefile.in (datarootdir): New variable.
1331 2008-06-12 H.J. Lu <hongjiu.lu@intel.com>
1333 PR preprocessor/36479
1334 * charset.c (cpp_interpret_string_notranslate): Also set
1335 narrow_cset_desc.width.
1337 2008-06-07 Joseph Myers <joseph@codesourcery.com>
1339 * configure.ac (parisc*64*-*-*): Remove.
1340 * configure: Regenerate.
1342 2008-05-30 Tom Tromey <tromey@redhat.com>
1344 PR preprocessor/36320:
1345 * internal.h (_cpp_parse_expr): Update.
1346 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
1348 * directives.c (do_if): Update.
1349 (do_elif): Require expression if processing group.
1351 2008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
1353 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
1355 2008-05-21 Tom Tromey <tromey@redhat.com>
1357 PR preprocessor/27777:
1358 * lex.c (cpp_output_line_to_string): New function.
1359 * internal.h (_cpp_begin_message): Don't declare.
1360 * errors.c (_cpp_begin_message): Now static.
1361 * include/cpplib.h (cpp_output_line_to_string): Declare.
1362 * directives.c (do_diagnostic): Rewrote. Use
1363 cpp_output_line_to_string. Don't use _cpp_begin_message.
1365 2008-05-21 Tom Tromey <tromey@redhat.com>
1367 * include/symtab.h (HT_ALLOCED): Remove.
1368 (ht_purge): Declare.
1369 * symtab.c (DELETED): New define.
1370 (ht_lookup): Update comment.
1371 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
1372 code. Use subobject allocator for strings, if it exists.
1373 (ht_expand): Handle deleted entries.
1374 (ht_forall): Likewise.
1375 (ht_purge): New function.
1376 (ht_dump_statistics): Print deletion statistics.
1378 2008-05-13 Tom Tromey <tromey@redhat.com>
1380 PR preprocessor/22168:
1381 * include/cpplib.h (struct cpp_options) <objc>: Update
1383 * expr.c (eval_token): Warn for use of assertions.
1384 * directives.c (directive_diagnostics): Warn about extensions.
1385 (DEPRECATED): New define.
1386 (DIRECTIVE_TABLE): Use it.
1388 2008-05-06 Tom Tromey <tromey@redhat.com>
1390 PR preprocessor/35313, PR preprocessor/36088:
1391 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
1392 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
1394 2008-05-04 David S. Miller <davem@davemloft.net>
1396 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
1397 * configure: Regenerate.
1399 2008-04-22 Daniel Franke <franke.daniel@gmail.com>
1401 * include/cpplib.h (cpp_define_formatted): New.
1402 * directives.c (cpp_define_formatted): New.
1404 2008-04-21 Tom Tromey <tromey@redhat.com>
1407 * charset.c (_cpp_convert_input): Add buffer_start argument.
1408 Ignore UTF-8 BOM if seen.
1409 * internal.h (_cpp_convert_input): Add argument.
1410 * files.c (struct _cpp_file) <buffer_start>: New field.
1411 (destroy_cpp_file): Free buffer_start, not buffer.
1412 (_cpp_pop_file_buffer): Likewise.
1413 (read_file_guts): Update.
1415 2008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1417 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
1418 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
1419 (struct cpp_options): Added uliterals.
1420 (cpp_interpret_string): Update prototype.
1421 (cpp_interpret_string_notranslate): Idem.
1422 * charset.c (init_iconv_desc): New width member in cset_converter.
1423 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
1424 (convert_ucn): Idem.
1425 (emit_numeric_escape): Idem.
1426 (convert_hex): Idem.
1427 (convert_oct): Idem.
1428 (convert_escape): Idem.
1429 (converter_for_type): New function.
1430 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
1431 (cpp_interpret_string_notranslate): Match changed prototype.
1432 (wide_str_to_charconst): Use converter_for_type.
1433 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
1434 * directives.c (linemarker_dir): Macro U changed to UC.
1435 (parse_include): Idem.
1436 (register_pragma_1): Idem.
1437 (restore_registered_pragmas): Idem.
1438 (get__Pragma_string): Support CPP_STRING{16,32}.
1439 * expr.c (eval_token): Support CPP_CHAR{16,32}.
1440 * init.c (struct lang_flags): Added uliterals.
1441 (lang_defaults): Idem.
1442 * internal.h (struct cset_converter) <width>: New field.
1443 (struct cpp_reader) <char16_cset_desc>: Idem.
1444 (struct cpp_reader) <char32_cset_desc>: Idem.
1445 * lex.c (digraph_spellings): Macro U changed to UC.
1447 (lex_string): Add support for u'...', U'...', u"..." and U"...".
1448 (_cpp_lex_direct): Idem.
1449 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
1450 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
1452 2008-04-18 Paolo Bonzini <bonzini@gnu.org>
1455 * aclocal.m4: Regenerate.
1456 * configure: Regenerate.
1458 2008-04-17 Tom Tromey <tromey@redhat.com>
1461 * errors.c (cpp_error): Don't reference a token before the start
1464 2008-04-16 Tom Tromey <tromey@redhat.com>
1466 * Makefile.in (TAGS_SOURCES): New variable.
1469 2008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
1471 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
1473 * configure: Rebuilt.
1475 2008-04-02 Joseph Myers <joseph@codesourcery.com>
1477 * include/cpplib.h (struct cpp_callbacks): Add used_define,
1478 used_undef and before_define.
1479 (NODE_USED): Define.
1480 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
1481 do_ifndef, cpp_pop_definition): Handle new flag and use new
1483 * expr.c (parse_defined): Handle new flag and use new callbacks.
1484 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
1485 flag and use new callbacks.
1487 2008-04-01 Jakub Jelinek <jakub@redhat.com>
1490 * files.c (struct _cpp_file): Remove pch field.
1491 (pch_open_file): Don't set file->pch, just file->pchname.
1492 (should_stack_file): After pfile->cb.read_pch call
1493 free pchname and clear pchname, don't close file->fd.
1494 Test file->pchname instead of file->pch. Don't close fd after cb.
1495 (_cpp_stack_include): Test file->pchname instead of file->pch.
1497 2008-03-28 Tom Tromey <tromey@redhat.com>
1499 * Makefile.in (POSTCOMPILE): New variable.
1502 2008-03-13 Tom Tromey <tromey@redhat.com>
1505 * directives.c (destringize_and_run): Set pfile->directive.
1507 2008-03-06 Markus Milleder <markus.milleder@generali.at>
1509 PR preprocessor/35458
1510 * mkdeps.c (munge): Quote '#' with a '\'.
1512 2008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1514 PR preprocessor/35379
1515 * mkdeps.c (deps_write): Ensure the first target always appears
1516 in the first column, without leading backslash newline. Avoid
1517 some more extra whitespace.
1519 2008-02-25 Thiemo Seufer <ths@mips.com>
1521 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
1523 2008-02-19 Tom Tromey <tromey@redhat.com>
1525 * traditional.c (lex_identifier): Use CPP_HASHNODE.
1526 * lex.c (lex_identifier): Use CPP_HASHNODE.
1527 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
1529 * identifiers.c (alloc_node): Change return type.
1530 (_cpp_init_hashtable): Don't cast 'alloc_node'.
1531 (proxy_assertion_broken): New declaration.
1532 (cpp_forall_identifiers): Move comment.
1533 * line-map.c (linemap_add): Comment fix.
1534 (linemap_line_start): Indentation fix.
1536 2008-01-25 Jakub Jelinek <jakub@redhat.com>
1538 PR preprocessor/34692
1539 * macro.c (collect_args): Add pragma_buff argument. Push
1540 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
1541 than into arguments. Reset prevent_expansion and parsing_args
1542 state at CPP_PRAGMA_EOL/CPP_EOF.
1543 (funlike_invocation_p): Add pragma_buff argument, pass it through
1545 (enter_macro_context): Add result argument. Adjust
1546 funlike_invocation_p caller. Emit all deferred pragma tokens
1547 gathered during collect_args before the expansion, add a padding
1548 token. Return 2 instead of 1 if any pragma tokens were prepended.
1549 (cpp_get_token): If enter_macro_context returns 2, don't return
1550 a padding token, instead cycle to grab CPP_PRAGMA token.
1551 * directives.c (_cpp_handle_directive): If was_parsing_args
1552 in deferred pragma, leave parsing_args and prevent_expansion as is.
1554 2008-01-22 Tom Tromey <tromey@redhat.com>
1557 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
1558 __STDC_CONSTANT_MACROS.
1560 2008-01-07 Fred Fish <fnf@specifix.com>
1562 PR preprocessor/30363
1563 * traditional.c (replace_args_and_push): Add local variable
1564 cxtquote, calculate the replacement text size assuming a
1565 worst case of every input character quoted with backslash,
1566 and properly handle output quoting of quote characters in
1567 actual arguments used in function-like macros.
1569 2008-01-03 Tom Tromey <tromey@redhat.com>
1571 PR preprocessor/34602
1572 * directives.c (do_line): Don't try to spell EOF token.
1573 (do_linemarker): Add comment.
1575 2007-12-11 DJ Delorie <dj@redhat.com>
1577 * charset.c (convert_using_iconv): Close out any shift states,
1578 returning to the initial state.
1580 2007-12-06 Tom Tromey <tromey@redhat.com>
1583 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
1585 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
1586 * files.c (FILE_HASH_POOL_SIZE): New macro.
1587 (struct file_hash_entry_pool): New.
1588 (destroy_all_cpp_files): New function.
1589 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
1590 (new_file_hash_entry): Update.
1591 (free_file_hash_entries): New function.
1592 (_cpp_cleanup_files): Call free_file_hash_entries and
1593 destroy_all_cpp_files.
1594 (cpp_clear_file_cache): New function.
1595 * include/cpplib.h (cpp_clear_file_cache): Declare.
1597 2007-12-03 Tom Tromey <tromey@redhat.com>
1599 PR preprocessor/34288
1600 * configure.ac, config.in: Rebuilt.
1601 * configure.ac: Check for ssize_t.
1603 2007-11-30 Tom Tromey <tromey@redhat.com>
1605 PR preprocessor/32868
1606 * macro.c (_cpp_create_definition): Special case
1607 __STDC_FORMAT_MACROS.
1609 2007-11-16 Michael Matz <matz@suse.de>
1611 * files.c (search_path_head): Fix check for absolute paths.
1613 2007-11-11 Tom Tromey <tromey@redhat.com>
1616 * include/cpplib.h (cpp_included_before): Declare.
1617 * files.c (struct file_hash_entry) <location>: New field.
1618 (_cpp_find_file): Initialize new field.
1619 (make_cpp_dir): Likewise.
1620 (cpp_included_before): New function.
1622 2007-11-01 Tom Tromey <tromey@redhat.com>
1624 PR preprocessor/30805
1625 * macro.c (paste_tokens): Handle padding token.
1626 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
1628 2007-10-31 Tom Tromey <tromey@redhat.com>
1630 PR preprocessor/30786
1631 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
1632 * directives.c (_cpp_do__Pragma): Return error status.
1633 * internal.h (_cpp_do__Pragma): Update.
1634 * directives.c (get__Pragma_string): Back up if EOF seen.
1636 2007-09-06 Tom Tromey <tromey@redhat.com>
1638 * internal.h (struct cpp_reader) <invocation_location>: New
1640 (struct cpp_reader) <set_invocation_location>: Likewise.
1641 * init.c (cpp_set_line_map): New function.
1642 * line-map.c (linemap_add): Use linemap's allocator.
1643 * include/line-map.h (GTY): Define.
1644 (line_map_realloc): New typedef.
1645 (struct line_map): Mark with GTY.
1646 (struct line_maps): Likewise.
1647 (struct line_maps) <maps>: Likewise.
1648 (struct line_maps) <reallocator>: New field.
1649 * include/symtab.h (GTY): Conditionally define.
1650 * include/cpplib.h (cpp_set_line_map): Declare.
1651 (cpp_get_token_with_location): Declare.
1652 * macro.c (cpp_get_token): Set invocation_location on the reader.
1653 (cpp_get_token_with_location): New function.
1655 2007-08-30 Chao-ying Fu <fu@mips.com>
1657 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
1658 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
1659 (cpp_classify_number): Support decimal fixed-point constants without
1661 Warn about fixed-point constants when -pedantic.
1662 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
1663 comments to support fixed-point values.
1664 (CPP_N_FRACT, CPP_N_ACCUM): Define.
1666 2007-08-18 Tom Tromey <tromey@redhat.com>
1668 PR preprocessor/32974
1669 * directives.c (parse_include): Don't check for EOL when
1670 processing #pragma dependency.
1672 2007-07-30 Ollie Wild <aaw@google.com>
1674 * directives-only.c: New file.
1675 * internal.h (struct _cpp_dir_only_callbacks): New.
1676 (_cpp_preprocess_dir_only): New function.
1677 * directives.c (_cpp_handle_directive): Check directives_only before
1678 disabling execution of indented directives.
1679 * files.c (_cpp_stack_file): Add directives_only check.
1680 * include/cpplib.h (struct cpp_options): Add directives_only.
1681 (cpp_init_special_builtins): New function.
1682 * init.c (cpp_init_special_builtins): New function.
1683 (cpp_init_builtins): Move builtin_array initialization to
1684 cpp_init_special_builtins.
1685 (post_options): Check directives_only before setting
1686 pfile->state.prevent_expansion = 1.
1687 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
1688 is expanded inside a directive while -fdirectives-only is enabled.
1689 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
1690 (libcpp_a_SOURCES): Add directives-only.c.
1692 2007-07-04 Uros Bizjak <ubizjak@gmail.com>
1694 * traditional.c (_cpp_scan_out_logical_line): Initialize
1695 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
1696 fmacro.args to prevent 'may be used uninitialized' warning.
1698 2007-07-03 Uros Bizjak <ubizjak@gmail.com>
1700 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
1702 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
1703 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
1704 for 'q' or 'Q' suffixes.
1706 2007-06-17 Danny Smith <dannysmith@users.sourceforge.net
1708 * files.c (open_file): Correct typo.
1710 2007-06-16 Vladimir Prus <vladimir@codesourcery.com>
1712 * files.c (open_file): Prevent the call
1713 for stat from overwriting errno.
1715 2007-06-09 Vladimir Prus <vladimir@codesourcery.com>
1717 * files.c (open_file): Account for the
1718 fact that on windows, opening a directory gives
1721 2007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
1723 PR preprocessor/23479
1724 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
1726 (append_digit): Likewise.
1727 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
1728 binary integer constants.
1730 2007-05-31 Dave Korn <dave.korn@artimi.com>
1732 PR preprocessor/14331
1733 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
1735 2007-05-24 Ollie Wild <aaw@google.com>
1737 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
1738 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
1739 (cpp_write_pch_state): Save __COUNTER__ state.
1740 (cpp_valid_state): Check valid __COUNTER__ state.
1741 (cpp_read_state): Read new __COUNTER__ state.
1742 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
1743 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
1744 * internal.h (struct cpp_reader): Add counter member.
1746 2007-05-23 Simon Martin <simartin@users.sourceforge.net>
1748 PR preprocessor/20077
1749 * macro.c (create_iso_definition): Fixed the method to determine
1750 whether the token-pasting operator appears at the beginning or the end
1753 2007-05-21 Ian Lance Taylor <iant@google.com>
1755 * internal.h (struct cpp_reader): Add new fields:
1756 nonexistent_file_hash and nonexistent_file_ob.
1757 * files.c: Include "obstack.h".
1758 (find_file_in_dir): Before trying to open the file, look up the
1759 path name in the hash table of nonexistent files. After failing
1760 to open the file, add the path name to the hash table.
1761 (_cpp_find_file): Cache the results of looking up the file name
1762 starting with the quote and bracket chain heads, if we can.
1763 (nonexistent_file_hash_eq): New static function.
1764 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
1765 pfile->nonexistent_file_ob.
1766 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
1767 pfile->nonexistent_file_ob.
1769 2007-05-14 Janis Johnson <janis187@us.ibm.com>
1771 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
1774 * expr.c (interpret_float_suffix): Check for invalid suffix.
1776 2007-05-02 Eric Christopher <echristo@apple.com>
1778 * expr.c (num_div_op): Don't overflow if the result is
1781 2007-05-02 Tom Tromey <tromey@redhat.com>
1783 PR preprocessor/28709
1784 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
1786 2007-03-30 Michael Meissner <michael.meissner@amd.com>
1788 * directives.c (lex_macro_node_from_str): Fix alloca call to be
1791 2007-03-30 Richard Henderson <rth@redhat.com>
1793 * directives.c (lex_macro_node_from_str): New.
1794 (cpp_push_definition, cpp_pop_definition): New.
1795 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
1797 2007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1799 * Makefile.in: Add dummy install-pdf target.
1801 2007-01-30 Tom Tromey <tromey@redhat.com>
1803 PR preprocessor/30468
1804 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
1807 2007-01-30 Tom Tromey <tromey@redhat.com>
1809 PR preprocessor/29966
1810 * macro.c (lex_expansion_token): Save and restore cpp_reader's
1812 (_cpp_create_definition): Don't restore cur_token here.
1813 * lex.c (_cpp_lex_token): Added assertion.
1815 2007-01-27 Tom Tromey <tromey@redhat.com>
1817 * configure: Rebuilt.
1819 2007-01-12 Tom Tromey <tromey@redhat.com>
1821 PR preprocessor/28227
1822 * directives.c (lex_macro_node): Added 'is_def_or_undef'
1824 (do_define): Update.
1827 (do_ifndef): Update.
1829 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
1831 * configure: Regenerate.
1833 2007-01-11 Paolo Bonzini <bonzini@gnu.org>
1835 * configure: Regenerate.
1837 2007-01-04 Tom Tromey <tromey@redhat.com>
1839 PR preprocessor/28165
1840 * internal.h (cpp_in_primary_file): New function.
1841 * directives.c (do_include_next): Use cpp_in_primary_file.
1842 (do_pragma_once): Likewise.
1843 (do_pragma_system_header): Likewise.
1845 2006-12-29 Ian Lance Taylor <iant@google.com>
1847 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
1848 look backward at the end of the line unless we saw a backslash.
1850 2006-12-29 Jakub Jelinek <jakub@redhat.com>
1852 PR preprocessor/29612
1853 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
1854 only when new_sysp is non-zero.
1856 2006-12-28 Tom Tromey <tromey@redhat.com>
1858 PR preprocessor/30001
1859 * charset.c (_cpp_convert_input): Check that to.len is greater
1862 2006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
1864 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
1865 * configure: Rebuilt.
1867 2006-11-01 Douglas Gregor <doug.gregor@gmail.com>
1869 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
1870 for experimental C++0x mode.
1871 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
1872 adopted the preprocessor changes introduced in C99.
1874 2006-10-29 Joseph Myers <joseph@codesourcery.com>
1876 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
1877 depending on --enable-targets=all.
1878 * configure: Regenerate.
1880 2006-10-12 Jakub Jelinek <jakub@redhat.com>
1882 PR preprocessor/28709
1883 * macro.c (paste_tokens): Do error reporting here, use BUF with the
1884 spelled LHS token as opposed to spelling it again.
1885 (paste_all_tokens): Don't report errors here, just break on failure.
1887 2006-10-10 Brooks Moses <bmoses@stanford.edu>
1889 * Makefile.in: Added empty "pdf" target.
1891 2006-09-22 Geoffrey Keating <geoffk@apple.com>
1893 * configure.ac: Make need_64_bit_hwint case for x86-darwin
1894 match exactly the glob in gcc/config.gcc.
1895 * configure: Regenerate.
1897 2006-09-13 Joseph S. Myers <joseph@codesourcery.com>
1900 PR preprocessor/14634
1901 * lex.c (lex_string): Pedwarn for unterminated literals.
1903 2006-09-08 Eric Christopher <echristo@apple.com>
1905 * configure.ac: Add 64-bit HWI support for i?86-darwin.
1907 2006-08-14 Steve Ellcey <sje@cup.hp.com>
1911 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
1912 (CPP_LAST_EQ): Change.
1913 (CPP_LAST_PUNCTUATOR): Change.
1914 * expr.c (cpp_operator): Remove MIN and MAX.
1915 (reduce): Remove CPP_MIN and CPP_MAX.
1916 (num_binary_op): Ditto.
1917 * lex.c (_cpp_lex_direct): Ditto.
1918 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
1920 2006-06-09 Jakub Jelinek <jakub@redhat.com>
1922 PR preprocessor/27746
1923 * directives.c (do_pragma): Handle pragma with valid namespace
1924 and invalid name coming from macro expansion.
1925 * directives.c (destringize_and_run): Initialize next field in
1930 * directives.c (destringize_and_run): Set NO_EXPAND on the
1933 * macro.c (_cpp_backup_tokens): Fix comment typo.
1935 2006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
1937 * Makefile.in (CATALOGS): Add po/ prefix.
1938 * configure: Regenerated.
1940 2006-05-23 Carlos O'Donell <carlos@codesourcery.com>
1942 * Makefile.in: Add install-html target. Add install-html to .PHONY
1944 2006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
1946 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
1947 * files.c (_cpp_get_file_stat): New function.
1948 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
1949 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
1950 * internal.h (_cpp_get_file_stat): Prototype.
1951 (struct cpp_buffer): Add timestamp.
1953 2006-01-23 Jakub Jelinek <jakub@redhat.com>
1955 PR preprocessor/25717
1956 * init.c (cpp_init_builtins): If __STDC__ will not change value
1957 between system headers and other sources, define it as a normal
1958 macro rather than a builtin.
1959 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
1960 cpp_in_system_header condition.
1962 2006-01-05 Paolo Bonzini <bonzini@gnu.org>
1964 * Makefile.in: Use -MMD instead of -MD.
1966 2006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
1967 Richard Henderson <rth@redhat.com>
1969 Merge from gomp branch:
1970 * directives.c (struct pragma_entry): Add is_deferred. Add ident
1971 entry to value union.
1972 (end_directive): Don't eat the line if in_deferred_pragma.
1973 (run_directive): Remove pragma hacks.
1974 (insert_pragma_entry): Remove.
1975 (new_pragma_entry): New.
1976 (register_pragma_1): Split out of register_pragma. Only handle
1977 the lookup tree and return the new entry.
1978 (cpp_register_pragma): Fill in the pragma entry here.
1979 (cpp_register_deferred_pragma): New.
1980 (register_pragma_internal): New.
1981 (_cpp_init_internal_pragmas): Use register_pragma_internal.
1982 (do_pragma): Allow pragma expansion after namespace. For deferred
1983 pragmas, don't slurp the line into a string.
1984 (destringize_and_run): Save tokens for deferred pragmas.
1985 (cpp_handle_deferred_pragma): Remove.
1986 * macro.c (builtin_macro): Remove pragma token hack.
1987 (_cpp_push_token_context): Rename from push_token_context and export.
1988 * internal.h (struct lexer_state): Add pragma_allow_expansion.
1989 (_cpp_push_token_context): Declare.
1990 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
1991 a token. Update the line number correctly if so.
1992 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
1993 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
1994 * include/cpplib.h (PRAGMA_EOL): New.
1995 (CPP_TOKEN_FLD_PRAGMA): New.
1996 (struct cpp_token): Add val.pragma.
1997 (struct cpp_options): Remove defer_pragmas.
1998 (cpp_handle_deferred_pragma): Remove.
1999 (cpp_register_deferred_pragma): Declare.
2001 2006-01-01 Jakub Jelinek <jakub@redhat.com>
2004 * directives.c (do_pragma): If pragma line ends with multi-line
2005 block comment, end the saved deferred pragma string before that
2006 comment. Handle embedded '\0' chars on the pragma line.
2008 2005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
2011 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
2013 2005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
2014 Ben Elliston <bje@au.ibm.com>
2016 * include/cpplib.h (CPP_N_DFLOAT): New.
2017 * expr.c (interpret_float_suffix): Identify df, dd, and dl
2018 suffixes as decimal floating point constants.
2019 (cpp_classify_number): Disallow hexadecimal DFP constants.
2021 2005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
2022 Ian Lance Taylor <ian@airs.com>
2024 * include/cpplib.h (struct cpp_callbacks): Annotate error with
2025 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
2027 2005-11-09 Per Bothner <per@bothner.com>
2028 Uros Bizjak <uros@kss-loka.si>
2031 * init.c (read_original_filename): Temporarily set
2032 state.in_directive before calling _cpp_lex_direct for
2035 2005-11-03 James E Wilson <wilson@specifix.com>
2037 PR preprocessor/24202
2038 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
2040 2005-11-04 Joseph S. Myers <joseph@codesourcery.com>
2042 * include/cpplib.h (struct cpp_callbacks): Make error take
2044 * errors.c (cpp_error): Update call to callback.
2046 2005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
2048 PR preprocessor/22042
2049 * macro.c (_cpp_builtin_macro_text): Lower the needed max
2051 (cpp_quote_string): Don't octalify non printable
2054 2005-11-03 Joseph S. Myers <joseph@codesourcery.com>
2057 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
2058 (struct cpp_callbacks): Add error.
2059 * errors.c (cpp_error): If client_diagnostic, use error callback.
2060 * charset.c (convert_escape): Don't use %03o in diagnostic.
2062 2005-10-21 James E Wilson <wilson@specifix.com>
2064 PR preprocessor/15220
2065 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
2066 callers. Pass to open_file_failed.
2067 (open_file_failed): New parameter angle_brackets. Fix all callers.
2068 Use in print_dep assignment.
2069 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
2070 * internal.h (_cpp_find_file): Add new parm to declaration.
2072 2005-10-08 Kazu Hirata <kazu@codesourcery.com>
2074 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
2075 * configure: Regenerate.
2077 2005-10-04 Ian Lance Taylor <ian@airs.com>
2079 PR preprocessor/13726
2080 * directives.c (check_eol_return_comments): New static function.
2081 (parse_include): Add buf parameter. Change all callers.
2082 (do_include_common): If not discard comments, turn on
2083 save_comments. Pass collected comments to include callback.
2084 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
2085 include callback: cpp_token list.
2087 2005-09-20 Joseph S. Myers <joseph@codesourcery.com>
2089 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
2090 * init.c (struct lang_flags, lang_defaults): Add
2091 extended_identifiers.
2092 (cpp_set_lang): Use it.
2093 * lex.c (forms_identifier_p): Check extended_identifiers.
2095 2005-08-30 Jakub Jelinek <jakub@redhat.com>
2097 PR preprocessor/20348
2098 PR preprocessor/20356
2099 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
2102 2005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2104 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
2105 -Wmissing-format-attribute.
2107 * configure: Regenerate.
2109 2005-06-29 Kelley Cook <kcook@gcc.gnu.org>
2111 * all files: Update FSF address in copyright headers.
2112 * makeucnid.c (write_copyright): Update outputted FSF address.
2114 2005-06-13 Zack Weinberg <zack@codesourcery.com>
2116 * configure.ac: Invoke ZW_CREATE_DEPDIR and
2117 ZW_PROG_COMPILER_DEPENDENCIES.
2118 * aclocal.m4, configure: Regenerate.
2119 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
2121 (distclean): Clean up $(DEPDIR) and its contents.
2122 (.c.o): Use $(COMPILE).
2123 Include $(DEPDIR)/*.Po for most object->header dependencies.
2125 2005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2127 * configure.ac: Check declarations for asprintf and vasprintf.
2128 * config.in: Regenerate.
2129 * configure: Likewise.
2131 * charset.c (conversion_loop): Use XRESIZEVEC.
2132 (convert_no_conversion): Likewise.
2133 (convert_using_iconv): Likewise.
2134 (init_iconv_desc): Cast return value of alloca.
2135 (cpp_host_to_exec_charset): Use XNEWVEC.
2136 (emit_numeric_escape): Use XRESIZEVEC.
2137 (cpp_interpret_string): Use XNEWVEC.
2138 (cpp_interpret_string): Use XRESIZEVEC.
2139 (_cpp_interpret_identifier): Cast return value of alloca.
2140 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
2141 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
2142 (parse_include): Use XNEWVEC.
2143 (insert_pragma_entry): Rename local variable "new" to
2145 (save_registered_pragmas): Cast return value of xmemdup.
2146 (destringize_and_run): Same for alloca.
2147 (parse_assertion): Likewise.
2148 (do_assert): Cast allocated storage to proper type.
2149 (cpp_define): Likewise.
2150 (_cpp_define_builtin): Likewise.
2151 (cpp_undef): Likewise.
2152 (handle_assertion): Likewise.
2153 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
2154 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
2155 (CPP_UMINUS): Likewise.
2156 (struct cpp_operator): Rename from struct operator.
2157 (_cpp_expand_op_stack): Use XRESIZEVEC.
2158 * files.c (pch_open_file): Use XNEWVEC.
2159 (pch_open_file): Use XRESIZEVEC.
2160 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
2161 (dir_name_of_file): Use XNEWVEC.
2162 (make_cpp_file): Use XCNEW.
2163 (make_cpp_dir): Likewise.
2164 (allocate_file_hash_entries): USE XNEWVEC.
2165 (cpp_included): Cast return value of htab_find_with_hash.
2166 (append_file_to_dir): Use XNEWVEC.
2167 (read_filename_string): Likewise. Use XRESIZEVEC too.
2168 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
2169 (remap_filename): Use XNEWVEC.
2170 (struct pchf_entry): Move definition out of struct pchf_data.
2171 (_cpp_save_file_entries): Use XCNEWVAR.
2172 (_cpp_read_file_entries): Use XNEWVAR.
2173 * identifiers.c (alloc_node): Use XOBNEW.
2174 * init.c (cpp_create_reader): Use XCNEW.
2175 (cpp_init_builtins): Cast of b->value to enum builtin_type.
2176 (read_original_directory): Cast return value of alloca.
2177 * lex.c (add_line_note): Use XRESIZEVEC.
2178 (warn_about_normalization): Use XNEWVEC.
2179 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
2180 (new_buff): Use XNEWVEC.
2181 * line-map.c (linemap_add): Use XRESIZEVEC.
2182 * macro.c (builtin_macro): Cast return value of alloca.
2183 (paste_tokens): Likewise.
2184 (expand_arg): Use XNEWVEC and XRESIZEVEC.
2185 (_cpp_save_parameter): Use XRESIZEVEC.
2186 (create_iso_definition): Cast allocated storage to proper type.
2187 (_cpp_create_definition): Likewise.
2188 (cpp_macro_definition): Use XRESIZEVEC.
2189 * makedepend.c (add_clm): Use XNEW.
2190 (add_dir): Likewise.
2191 * mkdeps.c (munge): Use XNEWVEC.
2192 (deps_init): Use XCNEW.
2193 (deps_add_target): Use XRESIZEVEC.
2194 (deps_add_default_target): Cast return value of alloca.
2195 (deps_add_dep): Use XRESIZEVEC.
2196 (deps_add_vpath): Likewise. Use XNEWVEC too.
2197 (deps_restore): Likewise.
2198 * pch.c (save_idents): Use XNEW and XNEWVEC.
2199 (cpp_save_state): Use XNEW.
2200 (count_defs): Cast return value of htab_find.
2201 (write_defs): Likewise.
2202 (cpp_write_pch_deps): Use XNEWVEC.
2203 (collect_ht_nodes): Use XRESIZEVEC.
2204 (cpp_valid_state): Use XNEWVEC.
2205 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
2206 * symtab.c (ht_create): Use XCNEW.
2207 (ht_lookup_with_hash): Cast return value of obstack_copy0.
2208 (ht_expand): Use XCNEWVEC.
2209 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
2210 (bool): Do not define if __cplusplus.
2212 2005-05-12 Zack Weinberg <zack@codesourcery.com>
2214 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
2215 (do_sccs): Delete function definition, #define to do_ident.
2216 (do_ident): Don't hardwire directive name.
2218 2005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
2221 * configure: Regenerate.
2223 2005-04-27 Andris Pavenis <pavenis@latnet.lv>
2225 * files.c: Include io.h for DJGPP to get prototype of setmode.
2227 2005-04-19 Per Bothner <per@bothner.com>
2229 PR preprocessor/20907
2230 * line-map.c (linemap_line_start): Fix bug when we need to increse
2231 column_bits but can re-use the current line_map.
2233 2005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2235 * system.h (fopen, fdopen, freopen): Define these to the unlocked
2236 libiberty functions.
2238 2005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2240 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
2241 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
2242 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
2243 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
2245 (fwrite_unlocked): Fix prototype.
2247 * configure, config.in: Regenerate.
2249 2005-04-05 Jakub Jelinek <jakub@redhat.com>
2251 PR preprocessor/19475
2252 * macro.c (create_iso_definition): For < ISO C99, don't
2253 pedwarn if there is no whitespace between macro name and its
2254 replacement, but the replacement starts with a basic character
2257 2005-03-28 Andreas Jaeger <aj@suse.de>
2259 * lex.c (warn_about_normalization): Cast field width to int to
2262 2005-03-19 Joseph S. Myers <joseph@codesourcery.com>
2264 * configure.ac: Consistently use solaris2.1[0-9]* instead of
2266 * configure: Regenerate.
2268 2005-03-15 Geoffrey Keating <geoffk@apple.com>
2270 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
2271 UCN rather than printing an error.
2273 2005-03-14 Geoffrey Keating <geoffk@apple.com>
2275 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
2277 2005-03-14 Geoffrey Keating <geoffk@apple.com>
2279 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
2280 * charset.c: Update for new format of ucnid.h.
2281 (ucn_valid_in_identifier): Update for new format of ucnid.h.
2282 Add NST parameter, and update it; update callers.
2283 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
2285 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
2286 * internal.h (struct normalize_state): New.
2287 (INITIAL_NORMALIZE_STATE): New.
2288 (NORMALIZE_STATE_RESULT): New.
2289 (NORMALIZE_STATE_UPDATE_IDNUM): New.
2290 (_cpp_valid_ucn): New.
2291 * lex.c (warn_about_normalization): New.
2292 (forms_identifier_p): Add normalize_state parameter, update callers.
2293 (lex_identifier): Add normalize_state parameter, update callers. Keep
2295 (lex_number): Likewise.
2296 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
2297 it with warn_about_normalization.
2301 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
2302 comments about obsolete version of C++.
2303 * include/cpplib.h (enum cpp_normalize_level): New.
2304 (struct cpp_options): Add warn_normalize field.
2306 2005-03-11 Geoffrey Keating <geoffk@apple.com>
2308 * directives.c (glue_header_name): Update call to cpp_spell_token.
2309 * internal.h (_cpp_interpret_identifier): New.
2310 * charset.c (_cpp_interpret_identifier): New.
2311 (_cpp_valid_ucn): Allow UCN version of '$'.
2312 * lex.c (lex_identifier): Add extra parameter to indicate if initial
2313 character was '$' or '\'. Support identifiers with UCNs.
2314 (forms_identifier_p): Allow UCNs.
2315 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
2317 (cpp_spell_token): Add FORSTRING parameter. Use it.
2318 (cpp_token_as_text): Update call to cpp_spell_token.
2319 (cpp_output_token): Write UCNs back out.
2320 (stringify_arg): Update call to cpp_spell_token.
2321 (paste_tokens): Likewise.
2322 (cpp_macro_definition): Likewise.
2323 * macro.c (stringify_arg): Likewise.
2324 (paste_tokens): Likewise.
2325 (cpp_macro_definition): Likewise.
2326 * include/cpplib.h: Add parameter to cpp_spell_token.
2328 2005-03-04 Jakub Jelinek <jakub@redhat.com>
2332 * macro.c (replace_args, cpp_get_token): Copy whole
2333 cpp_token_u instead of just cpp_string field from it.
2335 2005-02-28 Devang Patel <dpatel@apple.com>
2337 * directives.c (do_line): Save sysp early before line table is
2340 2005-02-20 Zack Weinberg <zack@codesourcery.com>
2343 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
2344 (cpp_host_to_exec_charset): New function.
2345 * include/cpplib.h: Declare cpp_host_to_exec_charset.
2347 2005-02-19 Devang Patel <dpatel@apple.com>
2349 * charset.c (_cpp_convert_input): Check '\r' before inserting
2352 2005-02-15 Eric Christopher <echristo@redhat.com>
2354 PR preprocessor/19077
2355 * macro.c (cpp_macro_definition): Move handling of whitespace
2356 to PREV_WHITE conditional. Remove overloading of len
2359 2005-02-14 Kazu Hirata <kazu@cs.umass.edu>
2361 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
2362 traditional.c: Update copyright.
2364 2005-02-14 Paolo Bonzini <bonzini@gnu.org>
2367 * configure.ac: Check for declaration of basename and getopt.
2368 * config.in: Regenerate.
2369 * configure: Regenerate.
2370 * internal.h (ustrcspn): New.
2371 * macro.c (create_iso_definition): Fix allocation of memory.
2372 (padding_token): Add cast to remove const-ness.
2373 * pch.c (cpp_read_state): Use ustrcspn.
2375 2005-02-08 Mike Stump <mrs@apple.com>
2377 * files.c (pchf_adder): Remove.
2378 (struct pchf_adder_info): Likewise.
2379 (_cpp_save_file_entries): Write out all files so that #import works.
2381 2005-01-23 Joseph S. Myers <joseph@codesourcery.com>
2383 * configure: Regenerate.
2385 2005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
2387 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
2389 * include/cpplib.h: Also update copyright years.
2391 2005-01-03 Geoffrey Keating <geoffk@apple.com>
2393 * files.c (_cpp_find_file): Add files found by search_path_exhausted
2394 to the list of all files.
2396 2005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
2398 * internal.h: Update references to Cpp lib filenames.
2399 * directives.c: Likewise.
2401 * macro.c: Likewise.
2402 * traditional.c: Likewise.
2404 2004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
2406 PR preprocessor/15167
2407 * files.c (destroy_cpp_file): New function.
2408 (should_stack_file): Make a new file if the
2409 compared file is still stacked.
2411 2004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
2413 PR preprocessor/17610
2414 * directives.c (do_include_common): Error out if an empty filename
2415 is given for #include (or #include_next or #import).
2417 2004-11-27 Roger Sayle <roger@eyesopen.com>
2418 Zack Weinberg <zack@codesourcery.com>
2420 * internal.h: Replace all uses of uchar with unsigned char.
2421 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
2422 with !IN_GCC, so uchar is only defined whilst building libcpp.
2424 2004-11-24 Kelley Cook <kcook@gcc.gnu.org>
2426 * aclocal.m4: Regenerate.
2428 2004-11-24 Roger Sayle <roger@eyesopen.com>
2430 PR preprocessor/15824
2431 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
2432 directly, instead of the non-existant "system.h" and "ansidecl.h".
2433 * configure: Regenerate.
2435 2004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
2436 Joseph Myers <joseph@codesourcery.com>
2438 * internal.h (struct lexer_state): Add in_deferred_pragma.
2439 * directives.c (struct pragma_entry): Add allow_expansion.
2440 (insert_pragma_entry): Take allow_expansion flag.
2441 (register_pragma): Likewise.
2442 (cpp_register_pragma): Likewise.
2443 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
2444 (do_pragma): Honor allow_expansion.
2445 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
2446 * include/cpplib.h (cpp_register_pragma): Update prototype.
2448 2004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
2449 Mark Mitchell <mark@codesourcery.com>
2451 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
2452 need_64bit_hwint=yes.
2453 * configure: Regenerate.
2455 2004-11-09 Joseph S. Myers <joseph@codesourcery.com>
2457 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
2459 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
2460 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
2461 Remove local srcdir path from generated file.
2463 2004-11-04 Zack Weinberg <zack@codesourcery.com>
2464 Gerald Pfeifer <gerald@pfeifer.com>
2466 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
2469 2004-10-27 Zack Weinberg <zack@codesourcery.com>
2472 * directives.c (do_pragma): Do not defer pragmas which are unknown.
2473 (cpp_handle_deferred_pragma): Add cast to silence warning.
2475 2004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
2477 * errors.c (_cpp_begin_message): Print "error: " for errors.
2479 2004-10-10 Andreas Jaeger <aj@suse.de>
2481 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
2482 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
2484 2004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
2486 * pch.c (cpp_write_pch_state): Remove variable z as it is not
2488 (cpp_read_state): Remove unused variables, m, d and mac_count.
2490 2004-09-29 Per Bothner <per@bothner.com>
2492 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
2493 cb.line_change. Otherwise do_pragma will call the line_change
2494 call-back with a meaningless line number.
2496 2004-09-24 Zack Weinberg <zack@codesourcery.com>
2498 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
2499 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
2500 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
2501 * aclocal.m4, configure: Regenerate.
2502 * init.c: Include localedir.h.
2503 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
2505 (.c.o): Use $(ALL_CFLAGS).
2506 (localedir.h, localedir.hs): New rules.
2507 (clean): Use rm -rf to remove directories.
2508 (distclean): Also delete localedir.h and localedir.hs.
2509 (init.o): Update dependencies.
2511 2004-09-22 Kelley Cook <kcook@gcc.gnu.org>
2513 * Makefile.in (aclocal.m4): Update dependencies.
2514 * configure.ac (AC_CONFIG_MACRO_DIR): New.
2515 * aclocal.m4, configure: Regenerate.
2517 2004-09-17 Zack Weinberg <zack@codesourcery.com>
2519 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
2520 (_cpp_convert_input, _cpp_default_encoding): Add comments.
2521 Some other comments in this file also tweaked.
2523 * directives.c (do_pragma): Save current buffer position
2524 before lexing the pragma keywords; don't call
2525 _cpp_backup_tokens in the defer_pragmas case.
2527 2004-09-15 Per Bothner <per@bothner.com>
2529 * include/line-map.h (line_map_start): Add parameter names so
2530 preceding comment makes sense.
2531 (linemap_add): Remove from comment mention of non-existing parameter.
2533 2004-09-09 Matt Austern <austern@apple.com>
2534 Zack Weinberg <zack@codesourcery.com>
2536 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
2537 prefixes throughout. Add entry for PRAGMA. Remove
2538 unnecessary "= 0" from EQ.
2539 (enum cpp_ttype): Adjust OP and TK definitions to restore
2540 prefixes, via token-paste.
2541 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
2542 Change from #defines to additional cpp_ttype enumerators.
2543 (struct cpp_options): Add defer_pragmas.
2544 (cpp_handle_deferred_pragma): Prototype new interface.
2546 * internal.h (struct cpp_reader): Add directive_result.
2547 * directives.c (struct pragma_entry): Add is_internal field;
2548 give boolean fields type bool.
2549 (start_directive): Initialize pfile->directive_result.type.
2550 (_cpp_do__Pragma): Likewise.
2551 (run_directive): Do not crash if pfile->buffer->prev is NULL.
2552 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
2554 (register_pragma): New static function, bulk of former
2555 cpp_register_pragma here; add 'internal' argument, pass along
2556 to insert_pragma_entry.
2557 (cpp_register_pragma): Now a wrapper around register_pragma which
2558 always passes false for 'internal' argument.
2559 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
2560 true for 'internal'.
2561 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
2562 an internal pragma, save text till the end of the line as a CPP_PRAGMA
2563 token instead of executing the pragma.
2564 (cpp_handle_deferred_pragma): New interface.
2565 * lex.c (token_spellings): Adjust OP and TK definitions to
2566 match changes to cpplib.h.
2567 (_cpp_lex_token): Check for a directive-result token and
2568 return it if present.
2569 (cpp_token_val_index): Handle CPP_PRAGMA.
2570 * macro.c (cpp_builtin_macro_text): Correct comment.
2571 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
2573 2004-09-06 Serge Belyshev <belyshev@lubercy.com>
2575 PR preprocessor/14699
2576 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
2577 from size_t to double.
2579 2004-08-28 Andreas Schwab <schwab@suse.de>
2580 Andreas Jaeger <aj@suse.de>
2582 * configure.ac: Set PACKAGE correctly.
2583 * configure: Regenerated.
2585 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
2587 * Makefile.in: Add back top_builddir.
2589 2004-08-25 Paolo Bonzini <bonzini@gnu.org>
2591 * configure.ac: Replace Automake macro invocations
2592 with manual Autoconf checks and substitutions.
2593 * configure: Regenerate.
2594 * aclocal.m4: Regenerate.
2595 * config.in: Regenerate.
2596 * Makefile.am: Removed.
2597 * Makefile.in: Heavy simplification and reorganization.
2599 2004-08-09 Mark Mitchell <mark@codesourcery.com>
2601 * configure.ac (arm*-*-eabi*): New target.
2602 (arm*-*-symbianelf*): Likewise.
2603 * configure: Regenerated.
2605 2004-07-24 Bernardo Innocenti <bernie@develer.com>
2607 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
2608 * directives.c: Use XNEW-family macros from libiberty.
2610 * macro.c: Likewise.
2611 * cpplib.h (cpp_deps_style): Export enum with name.
2613 2004-07-23 Matthias Klose <doko@debian.org>
2615 * init.c (init_library): Use PACKAGE for the text domain.
2617 2004-07-16 Andris Pavenis <pavenis@latnet.lv>
2619 PR preprocessor/16366
2620 * internal.h (struct cpp_reader): New field dir_hash.
2621 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
2622 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
2624 2004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
2626 PR preprocessor/16192
2627 PR preprocessor/15913
2628 PR preprocessor/15572
2629 * expr.c (_cpp_parse_expr): Handle remaining cases where an
2630 expression is missing.
2631 * init.c (post_options): Traditional cpp doesn't do // comments.
2633 2004-06-30 Per Bothner <per@bothner.com>
2635 * include/line-map.h (fileline): Remove old typedef.
2636 * internal.h (struct cpp_reader): Use source_location typedef instead.
2638 2004-06-26 Zack Weinberg <zack@codesourcery.com>
2640 Partially revert patch of 2004-06-05.
2641 * files.c (search_cache): Remove pfile argument. Don't check
2642 for file that would be found by "" or <> search here...
2643 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
2644 Do not apply directory-of-current-file correction to files
2645 found by this check. Rearrange code slightly.
2647 2004-06-21 Geoffrey Keating <geoffk@apple.com>
2649 * files.c (should_stack_file): Correct swapped parameters to call
2651 * pch.c (cpp_valid_state): Handle -fpreprocessed.
2653 2004-06-15 Paolo Bonzini <bonzini@gnu.org>
2655 * Makefile.in: Regenerate with automake 1.8.5.
2656 * aclocal.m4: Likewise.
2657 * configure: Regenerate.
2659 2004-06-11 Zack Weinberg <zack@codesourcery.com>
2661 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
2662 * configure, config.in: Regenerate.
2663 * system.h: Unconditionally define bool as unsigned char,
2664 BOOL_BITFIELD as unsigned int.
2665 * .cvsignore: New file.
2667 2004-06-09 Geoffrey Keating <geoffk@apple.com>
2669 * traditional.c (push_replacement_text): Set macro->traditional.
2670 (save_replacement_text): Likewise.
2671 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
2672 (struct save_macro_item): Delete.
2673 (struct save_macro_data): Use a character array not the previous
2675 (save_macros): Save macro as text not as internal structures.
2676 (cpp_prepare_state): Update for changes to save_macro_data.
2677 (cpp_read_state): Don't read macros defined in PCH. Restore
2679 * macro.c (create_iso_definition): Honour alloc_subobject.
2680 Clear traditional flag.
2681 (_cpp_create_definition): Honour alloc_subobject.
2682 * lex.c (cpp_token_val_index): New.
2683 * internal.h: Include cpp-id-data.h.
2684 (uchar): Move definition to cpp-id-data.h.
2686 (cpp_macro): Likewise.
2687 * directives.c (struct answer): Move to cpp-id-data.h.
2688 (do_assert): Honour alloc_subobject.
2690 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
2691 * include/cpplib.h (struct cpp_string): Add GTY marker.
2692 (enum cpp_token_fld_kind): New.
2693 (struct cpp_token): Add GTY markers.
2694 (cpp_token_val_index): Prototype.
2695 (CPP_HASHNODE_VALUE_IDX): New.
2696 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
2697 * include/cpp-id-data.h: New file.
2699 2004-06-09 Paolo Bonzini <bonzini@gnu.org>
2701 * Makefile.am (all-local): New.
2702 * Makefile.in: Regenerate.
2704 2004-06-06 Roger Sayle <roger@eyesopen.com>
2706 * Makefile.am (LIBICONV): Declare.
2707 (makedepend_LDADD): Use LIBICONV.
2708 * Makefile.in: Regenerate.
2710 2004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
2712 * Makefile.am (LIBINTL): Declare
2713 (makedepend_LDADD): Use LIBINTL.
2714 * Makefile.in: Regenerate.
2716 2004-06-05 Zack Weinberg <zack@codesourcery.com>
2718 * Makefile.am: Add makedepend.
2719 * Makefile.in, aclocal.m4: Regenerate.
2720 * charset.c: Insert a space to avoid a warning.
2721 * directives.c: Include mkdeps.h.
2722 (_cpp_handle_directive): Reenable macro expander if appropriate.
2723 (undefine_macros): Inline body of _cpp_free_definition for speed.
2724 Do not call undef callback or _cpp_warn_if_unused_macro.
2725 (cpp_get_deps): New interface.
2726 * files.c (search_cache): Add pfile argument. Check for file
2727 that would be found by "" or <> search here...
2728 (_cpp_find_file): ...not here. Correct recorded start_dir of
2729 files found by directory-of-current-file search that would be
2730 found by "" or <> search.
2731 * init.c (cpp_add_dependency_target): Delete.
2732 * internal.h (struct lexer_state): Add discarding_output flag.
2733 * lex.c (lex_identifier): Compute hash function while scanning.
2734 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
2736 * makedepend.c: New file.
2737 * mkdeps.c (struct deps): Add vpath vector.
2738 (apply_vpath, deps_add_vpath): New function.
2739 (deps_free): Free vpath vector.
2740 (deps_add_dep, deps_add_target): Use apply_vpath.
2741 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
2742 (ht_lookup_with_hash): New function.
2743 * cpplib.h, mkdeps.h: Update prototypes.
2744 * symtab.h: Update prototypes.
2745 (HT_HASHSTEP, HT_FINISH): New macros.
2747 2004-05-29 Geoffrey Keating <geoffk@apple.com>
2749 * symtab.c (ht_create): Set entries_owned.
2750 (ht_destroy): Honour entries_owned.
2751 (ht_expand): Likewise.
2753 * include/symtab.h (struct ht): New field 'entries_owned'
2754 (ht_load): New prototype.
2756 2004-05-26 Paolo Bonzini <bonzini@gnu.org>
2759 * configure.ac: Fix m4 quoting when picking
2760 the size of HOST_WIDE_INT.
2761 * configure: Regenerate.
2763 2004-05-25 Paolo Bonzini <bonzini@gnu.org>
2765 * Makefile.am: the correct directory for
2766 gettext include files is given by @INCINTL@.
2767 * Makefile.in: Regenerate.
2769 2004-05-24 Paolo Bonzini <bonzini@gnu.org>
2771 * system.h [!ENABLE_NLS]: dgettext takes two
2774 2004-05-23 Paolo Bonzini <bonzini@gnu.org>
2776 Moved libcpp from the gcc subdirectory to the toplevel.
2777 * Makefile.am: New file.
2778 * Makefile.in: Regenerate.
2779 * configure.ac: New file.
2780 * configure: Regenerate.
2781 * config.in: Regenerate.
2782 * charset.c: Moved from gcc/cppcharset.c. Add note about
2783 brokenness of input charset detection. Adjust for change
2784 in name of cppucnid.h.
2785 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
2786 * expr.c: Moved from gcc/cppexp.c.
2787 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
2788 Remove #define of O_BINARY, it is in system.h.
2789 * identifiers.c: Moved from gcc/cpphash.c.
2790 * internal.h: Moved from gcc/cpphash.h. Change header
2791 guard name. All other files adjusted to match name change.
2792 * init.c: Moved from gcc/cppinit.c.
2793 (init_library) [ENABLE_NLS]: Call bindtextdomain.
2794 * lex.c: Moved from gcc/cpplex.c.
2795 * directives.c: Moved from gcc/cpplib.c.
2796 * macro.c: Moved from gcc/cppmacro.c.
2797 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
2798 * traditional.c: Moved from gcc/cpptrad.c.
2799 * ucnid.h: Moved from gcc/cppucnid.h. Change header
2801 * ucnid.pl: Moved from gcc/cppucnid.pl.
2802 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
2804 * symtab.c: Moved from gcc/hashtable.c.
2805 * line-map.c: Moved from gcc. Do not include intl.h.
2806 * mkdeps.c: Moved from gcc.
2807 * system.h: New file.
2808 * include/cpplib.h: Moved from gcc. Change header guard name.
2809 * include/line-map.h: Moved from gcc. Change header guard name.
2810 * include/mkdeps.h: Moved from gcc. Change header guard name.
2811 * include/symtab.h: Moved from gcc/hashtable.h. Change header