]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
2012-03-14 Paolo Carlini <paolo.carlini@oracle.com>
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
7ce78e23 12012-02-14 Walter Lee <walt@tilera.com>
2
3 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
4 * configure: Regenerate.
5
d6fb6576 62012-01-09 Richard Guenther <rguenther@suse.de>
7
8 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
9
5e791406 102012-01-09 Gary Funck <gary@intrepid.com>
11
12 PR preprocessor/33919
13 * files.c (_cpp_get_file_name): New. Implement file name
14 access function.
15 * internal.h (_cpp_get_file_name): New prototype.
16 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
17 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
18
131e69c7 192012-01-03 Olivier Hainque <hainque@adacore.com>
20
21 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
22
32074525 232011-12-20 Joseph Myers <joseph@codesourcery.com>
24
25 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
26 (CLK_STDC1X): Change to CLK_STDC11.
27 * init.c (lang_defaults): Update comments.
28 (cpp_init_builtins): Update language tests. Use 201112L for C11
29 __STDC_VERSION__.
30
80cfebdb 312011-12-20 Andreas Schwab <schwab@linux-m68k.org>
32
33 * configure: Regenerate.
34
705de1ef 352011-12-19 Andreas Schwab <schwab@linux-m68k.org>
36
37 * configure: Regenerate.
38
b735cc56 392011-12-07 Jakub Jelinek <jakub@redhat.com>
40
41 PR bootstrap/50237
42 * internal.h (_cpp_init_lexer): New prototype.
43 * init.c (init_library): Call it.
44 * lex.c (init_vectorized_lexer): Remove constructor attribute,
45 add inline keyword.
46 (HAVE_init_vectorized_lexer): Define.
47 (_cpp_init_lexer): New function.
48
80e34234 492011-12-03 Dodji Seketeli <dodji@redhat.com>
50
51 * macro.c (tokens_buff_remove_last_token)
52 (tokens_buff_put_token_to): Add an 'inline' function specifier to
53 the prototype.
54
b082215e 552011-11-22 Diego Novillo <dnovillo@google.com>
56
57 * include/line-map.h (linemap_dump): Declare.
58 (line_table_dump): Declare.
59 * line-map.c (linemap_dump): New.
60 (line_table_dump): New.
61
b06c89b6 622011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
63
64 PR c++/50958
65 * expr.c (cpp_userdef_char_remove_type): Fix typo.
66
7c801b60 672011-11-03 Michael Matz <matz@suse.de>
68
69 PR bootstrap/50857
70 * configure.ac: Check for -fno-exceptions -fno-rtti.
71 * configure: Regenerate.
72 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
73 (ALL_CXXFLAGS): Use it.
74
d8954404 752011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
76
77 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
78
7e783eb3 792011-11-02 Jason Merrill <jason@redhat.com>
80
81 PR c++/50810
82 * configure.ac: Add -Wno-narrowing to warning options.
83
0d84dc2d 842011-10-31 Jason Merrill <jason@redhat.com>
85
de803ff2 86 PR libstdc++/1773
87 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
88
0d84dc2d 89 PR c++/50920
90 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
91 CLK_GNUCXX0X to CLK_GNUCXX11.
92
244db24d 932011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
94
95 Implement C++11 user-defined literals.
96 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
97 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
98 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
99 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
100 (cpp_classify_number): Classify unrecognized tokens as user-defined
101 literals.
102 * include/cpplib.h: Add new tokens for user-defined literals.
103 * init.c: Add new preprocessor flag (cxx11).
104 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
105 including concatenation and promotion with suffixes.
106
68928989 1072011-10-24 Dodji Seketeli <dodji@redhat.com>
108
109 * line-map.c (linemap_macro_map_lookup): Fix logic.
110
5ebe2143 1112011-10-24 Dodji Seketeli <dodji@redhat.com>
112
113 * include/line-map.h (linemap_expand_location): Take a line table
114 parameter. Update comment.
115 (linemap_resolve_location): Update comment.
116 (linemap_expand_location_full): Remove.
117 * line-map.c (linemap_resolve_location): Handle reserved
118 locations; return a NULL map in those cases.
119 (linemap_expand_location): If location is reserved, return a
120 zeroed expanded location. Update comment. Take a line table to
121 assert that the function takes non-virtual locations only.
122 (linemap_expand_location_full): remove.
123 (linemap_dump_location): Handle the fact that
124 linemap_resolve_location can return NULL line maps when the
125 location resolves to a reserved location.
126
127 * line-map.c (linemap_macro_map_lookup): Fix logic.
128
a2eb22f0 1292011-10-22 Dodji Seketeli <dodji@redhat.com>
130
131 PR bootstrap/50778
132 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
133 context to act upon.
134 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
135 comment.
136 (cpp_token_from_context_at): Likewise.
137 (cpp_peek_token): Use the context to peek tokens from.
138
ac6130e2 1392011-10-20 Dodji Seketeli <dodji@redhat.com>
140
141 PR bootstrap/50801
142 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
143 number of tokens.
144
2a688977 1452011-10-18 Dodji Seketeli <dodji@redhat.com>
146
147 PR bootstrap/50760
148 * include/line-map.h (struct linemap_stats): Change the type of
149 the members from size_t to long.
150 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
151 iter->location_ptr.
152
a67520a9 1532011-10-17 Dodji Seketeli <dodji@redhat.com>
154
155 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
156 variable without using it if ENABLE_CHECKING is not defined. Mark
157 the LOCATION parameter as being unused.
158
1ae3520e 1592011-10-15 Tom Tromey <tromey@redhat.com>
160 Dodji Seketeli <dodji@redhat.com>
161
162 * include/line-map.h (struct line_maps::alloced_size_for_request):
163 New member.
164 * line-map.c (new_linemap): Use set->alloced_size_for_request to
165 get the actual allocated size of line maps.
166
e77b8253 1672011-10-15 Tom Tromey <tromey@redhat.com>
168 Dodji Seketeli <dodji@redhat.com>
169
170 * line-map.h (struct linemap_stats): Declare new struct.
171 (linemap_get_statistics): Declare ...
172 * line-map.c (linemap_get_statistics): ... new function.
173 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
174 Declare new counters.
175 (enter_macro_context, replace_args): Update
176 num_macro_tokens_counter.
177 (cpp_get_token_1): Update num_expanded_macros_counter.
178
62db153a 1792011-10-15 Tom Tromey <tromey@redhat.com>
180 Dodji Seketeli <dodji@redhat.com>
181
182 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
183 * include/line-map.h (linemap_dump_location): Declare ...
184 * line-map.c (linemap_dump_location): ... new function.
185
ce70f433 1862011-10-15 Tom Tromey <tromey@redhat.com>
187 Dodji Seketeli <dodji@redhat.com>
188
189 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
190 New option.
191 * internal.h (struct macro_context): New struct.
192 (enum context_tokens_kind): New enum.
193 (struct cpp_context)<tokens_kind>: New member of type enum
194 context_tokens_kind.
195 (struct cpp_context)<macro>: Remove this. Replace it with an enum
196 of macro and macro_context.
197 (struct cpp_context)<direct_p>: Remove.
198 (_cpp_remaining_tokens_num_in_context): Declare new function.
199 * directives.c (destringize_and_run): Adjust.
200 * lex.c (_cpp_remaining_tokens_num_in_context)
201 (_cpp_token_from_context_at): Define new functions
202 (cpp_peek_token): Use them.
203 * init.c (cpp_create_reader): Initialize the base context to zero.
204 (_cpp_token_from_context_at): Define new static function.
205 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
206 _cpp_token_from_context_at.
207 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
208 members.
209 (enum macro_arg_token_kind): New enum.
210 (struct macro_arg_token_iter): New struct.
211 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
212 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
213 (delete_macro_args, set_arg_token, get_arg_token_location)
214 (arg_token_ptr_at, macro_arg_token_iter_init)
215 (macro_arg_token_iter_get_token)
216 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
217 (expanded_token_index, tokens_buff_new, tokens_buff_count)
218 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
219 (tokens_buff_add_token, tokens_buff_remove_last_token)
220 (reached_end_of_context, consume_next_token_from_context): New
221 static functions.
222 (cpp_get_token_1): New static function. Split and extended from
223 cpp_get_token. Use reached_end_of_context and
224 consume_next_token_from_context. Unify its return point. Move
225 the location tweaking from cpp_get_token_with_location in here.
226 (cpp_get_token): Use cpp_get_token_1
227 (stringify_arg): Use the new arg_token_at.
228 (paste_all_tokens): Support tokens coming from extended tokens
229 contexts.
230 (collect_args): Return the number of collected arguments, by
231 parameter. Store virtual locations of tokens that constitute the
232 collected args.
233 (funlike_invocation_p): Return the number of collected arguments,
234 by parameter.
235 (enter_macro_context): Add a parameter for macro expansion point.
236 Pass it to replace_args and to the "used" cpp callback. Get the
237 number of function-like macro arguments from funlike_invocation_p,
238 pass it to the new delete_macro_args to free the memory used by
239 macro args. When -ftrack-macro-expansion is in effect, for macros
240 that have no arguments, create a macro map for the macro expansion
241 and use it to allocate proper virtual locations for tokens
242 resulting from the expansion. Push an extended tokens context
243 containing the tokens resulting from macro expansion and their
244 virtual locations.
245 (replace_args): Rename the different variables named 'count' into
246 variables with more meaningful names. Create a macro map;
247 allocate virtual locations of tokens resulting from this
248 expansion. Use macro_arg_token_iter to iterate over tokens of a
249 given macro. Handle the case of the argument of
250 -ftrack-macro-expansion being < 2. Don't free macro arguments
251 memory resulting from expand_arg here, as these are freed by the
252 caller of replace_arg using delete_macro_args now. Push extended
253 token context.
254 (next_context, push_ptoken_context, _cpp_push_token_context)
255 (_cpp_push_text_context): Properly initialize the context.
256 (expand_arg): Use the new alloc_expanded_arg_mem,
257 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
258 (_cpp_pop_context): Really free the memory held by the context.
259 Handle freeing memory used by extended tokens contexts.
260 (cpp_get_token_with_location): Use cpp_get_token_1.
261 (cpp_sys_macro_p): Adjust.
262 (_cpp_backup_tokens): Support the new kinds of token contexts.
263 * traditional.c (recursive_macro): Adjust.
264
97bfb9ef 2652011-10-15 Tom Tromey <tromey@redhat>
266 Dodji Seketeli <dodji@redhat.com>
267
268 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
269 member.
270 (MAX_SOURCE_LOCATION): New constant.
271 (struct line_map_ordinary, struct line_map_macro): New structs.
272 (struct line_map): Turn this into a union of the two above. Add
273 comments.
274 (struct maps_info): New struct.
275 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
276 These now carry the map information that was previously scattered
277 in struct line_maps.
278 (struct map_info::allocated): Fix comment.
279 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
280 (ORDINARY_MAP_STARTING_LINE_NUMBER)
281 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
282 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
283 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
284 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
285 (MACRO_MAP_EXPANSION_POINT_LOCATION)
286 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
287 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
288 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
289 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
290 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
291 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
292 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
293 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
294 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
295 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
296 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
297 information.
298 (linemap_check_ordinary, linemap_assert)
299 (linemap_location_before_p): New macros.
300 (linemap_position_for_line_and_column)
301 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
302 (linemap_macro_expansion_map_p)
303 (linemap_macro_map_loc_to_def_point)
304 (linemap_macro_map_loc_unwind_once)
305 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
306 (linemap_get_source_line linemap_get_source_column)
307 (linemap_map_get_macro_name, linemap_get_file_path)
308 (linemap_location_in_system_header_p)
309 (linemap_location_from_macro_expansion_p): Declare new functions.
310 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
311 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
312 accessors act on ordinary maps only.
313 (INCLUDED_FROM): Return NULL for main files; use the new
314 accessors.
315 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
316 (struct expanded_location): Move here from gcc/input.h
317 (linemap_resolve_location, linemap_expand_location)
318 (linemap_expand_location_full): Declare new functions.
319 * line-map.c: Include cpplib.h, internal.h
320 (linemap_enter_macro, linemap_add_macro_token)
321 (linemap_get_expansion_line, linemap_get_expansion_filename): New
322 functions that are private to libcpp.
323 (linemap_assert): New macro.
324 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
325 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
326 (linemap_macro_map_loc_unwind_toward_spelling)
327 (linemap_macro_map_loc_to_exp_point)
328 (first_map_in_common_1, first_map_in_common): New static
329 functions.
330 (new_linemap): Define new static functions. Extracted and
331 enhanced from ...
332 (linemap_add): ... here. Use linemap_assert in lieu of abort
333 previously.
334 (linemap_tracks_macro_expansion_locs_p)
335 (linemap_add_macro_token, linemap_macro_expansion_map_p)
336 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
337 (linemap_macro_map_loc_to_def_point)
338 (linemap_macro_map_loc_unwind_once)
339 (linemap_step_out_once, linemap_map_get_index)
340 (linemap_get_source_line,linemap_get_source_column)
341 (linemap_get_file_path, linemap_map_get_macro_name)
342 (linemap_location_in_system_header_p)
343 (linemap_location_originated_from_system_header_p)
344 (linemap_location_from_macro_expansion_p)
345 (linemap_tracks_macro_expansion_locs_p)
346 (linemap_resolve_location, linemap_expand_location)
347 (linemap_expand_location_full)
348 (linemap_tracks_macro_expansion_locs_p)
349 (linemap_position_for_line_and_column, linemap_compare_locations):
350 Define new public functions.
351 (linemap_init): Initialize ordinary and macro maps information in
352 the map set.
353 (linemap_check_files_exited): Use the new accessors.
354 (linemap_free): Remove this dead code.
355 (linemap_line_start): Assert this uses an ordinary map. Adjust to
356 use the new ordinary map accessors and data structures. Don't
357 overflow past the lowest possible macro token's location.
358 (linemap_position_for_column): Assert the ordinary maps of the map
359 set are really ordinary. Use ordinary map accessors.
360 (linemap_lookup): Keep the same logic but generalize to allow
361 lookup of both ordinary and macro maps. Do not crash when called
362 with an empty line table.
363 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
364 new API of line-map.h.
365 * directives.c (start_directive, do_line, do_linemarker)
366 (do_linemarker): Likewise.
367 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
368 (make_cpp_dir, cpp_make_system_header): Likewise.
369 * init.c (cpp_read_main_file): Likewise.
370 * internal.h (CPP_INCREMENT_LINE): Likewise.
371 (linemap_enter_macro, linemap_add_macro_token)
372 (linemap_get_expansion_line, linemap_get_expansion_filename): New
373 functions private to libcpp.
374 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
375 (skip_line_comment, skip_whitespace, lex_raw_string)
376 (_cpp_lex_direct): Likewise.
377 * macro.c (_cpp_builtin_macro_text): Likewise.
378 (_cpp_aligned_alloc): Initialize the new name member of the macro.
379 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
380 Likewise.
381 * errors.c (cpp_diagnostic): Adjust to new linemap API.
382
1dc92c59 3832011-08-28 Dodji Seketeli <dodji@redhat.com>
384
385 * line-map.c (linemap_add): Assert that reason must not be
386 LC_RENAME when called for the first time on a "main input file".
387
6ea2c7a3 3882011-08-22 Gabriel Charette <gchare@google.com>
389
390 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
391 * internal.h (struct cpp_reader): Add field forced_token_location_p.
392 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
393 (cpp_force_token_locations): New.
394 (cpp_stop_forcing_token_locations): New.
395
985e7f10 3962011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
397
398 PR libstdc++/1773
399 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
400
094a55ba 4012011-08-18 Joseph Myers <joseph@codesourcery.com>
402
403 * include/cpplib.h (struct cpp_options): Fix typo.
404
6f6f3dd7 4052011-08-18 Joseph Myers <joseph@codesourcery.com>
406
407 * include/cpplib.h (struct cpp_options): Add rliterals.
408 * init.c (struct lang_flags, lang_defaults): Add rliterals.
409 (cpp_set_lang): Set rliterals option.
410 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
411 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
412
80ea6373 4132011-08-15 Gabriel Charette <gchare@google.com>
414
415 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
416 Update all users to use linemap_position_for_column instead.
417
d44dc666 4182011-07-28 Gabriel Charette <gchare@google.com>
419
420 * include/line-map.h (struct line_maps):
421 Remove unused field last_listed. Update all users.
422
6b4db1bd 4232011-07-28 H.J. Lu <hongjiu.lu@intel.com>
424
425 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
426 * configure: Regenerated.
427
80e4662c 4282011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
429
430 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
431
6678cb4e 4322011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
433 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
434
435 PR bootstrap/49794
436 * configure.ac: Test AM_ICONV with CXX.
437 * configure: Regenerate.
438 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
439
c219ee5c 4402011-07-15 Dodji Seketeli <dodji@redhat.com>
441
442 * directives.c (struct if_stack): Use source_location as type
443 here.
444 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
445 indent, def_pragma, used_define, used_undef>: Properly use
446 source_location as parameter type, rather than unsigned int.
447
14f27bc6 4482011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
449
450 PR target/39150
451 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
452 like i[34567]86-*-solaris2.1[0-9]*.
453 * configure: Regenerate.
454
414663ef 4552011-06-16 Jason Merrill <jason@redhat.com>
456
457 PR c++/45399
458 * lex.c (lex_raw_string): Don't check for embedded NUL.
459
2c694d44 4602011-06-06 Dodji Seketeli <dodji@redhat.com>
461
462 PR preprocessor/48532
463 * directives.c (do_pragma): Don't forget the invocation location
464 when parsing the pragma name of a namespaced pragma directive.
465
9793dd8e 4662011-05-29 John Tytgat <John.Tytgat@aaug.net>
467
468 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
469
cef70b8a 4702011-05-22 Uros Bizjak <ubizjak@gmail.com>
471
472 PR target/49104
473 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
474 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
475
cdd0bb4b 4762011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
477
478 * system.h (ENUM_BITFIELD): Remove.
479
0ff0cd04 4802011-04-24 Jakub Jelinek <jakub@redhat.com>
481
482 PR preprocessor/48740
483 * lex.c (lex_raw_string): When raw string ends with
484 ??) followed by raw prefix and ", ensure it is preprocessed
485 with ??) rather than ??].
486
dd045aee 4872011-04-20 Jim Meyering <meyering@redhat.com>
488
489 * files.c (destroy_cpp_file): Remove useless if-before-free.
490 * init.c (cpp_destroy): Likewise.
491 * macro.c (replace_args): Likewise.
492 * pch.c (cpp_valid_state): Likewise.
493
bb7824b5 4942011-03-25 Kai Tietz <ktietz@redhat.com>
495
496 * files.c (file_hash_eq): Use filename_cmp
497 instead of strcmp.
498 (nonexistent_file_hash_eq): Likewise.
499 (remap_filename): Likewise.
500 Handle absolute DOS-path,
501 (append_file_to_dir): Check for IS_DIR_SEPARATOR
502 instead of slash.
503 (read_name_map): Likewise.
504 * linemap.c (linemap_add): Use filename_cmp
505 instead of strcmp.
506 * mkdeps.c (apply_vpath): Use filename_ncmp
507 instead of strncmp.
508 (deps_restore): Use filename_cmp instead of
509 strcmp.
510 * init.c (read_original_directory): Use
511 IS_DIR_SEPARATOR instead of checking for slash.
512
00e59df9 5132011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
514
515 PR preprocessor/48192
516 * directives.c (do_ifdef): Do not consider conditional macros as
517 being defined.
518 (do_ifndef): Ditto.
519 * expr.c (parse_defined): Ditto.
520
70ebee13 5212011-03-18 Richard Henderson <rth@redhat.com>
522
523 PR bootstrap/45381
524 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
525
65861c3e 5262011-11-04 Eric Botcazou <ebotcazou@adacore.com>
527 Jakub Jelinek <jakub@redhat.com>
528
529 PR preprocessor/39213
530 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
531 pragmas as well in traditional mode.
532
be04fdf9 5332010-11-17 Ian Lance Taylor <iant@google.com>
534
535 PR bootstrap/45538
536 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
537 AC_LANG based on ENABLE_BUILD_WITH_CXX.
538
560ab0b2 5392010-11-16 Kai Tietz <kai.tietz@onevision.com>
540
541 PR preprocessor/17349
542 * lex.c (save_comment): Handle in argument passing c++
543 comments special.
544
075f1161 5452010-11-02 Ian Lance Taylor <iant@google.com>
546
547 * configure.ac: Use AC_SYS_LARGEFILE.
548 * configure: Rebuild.
549 * config.in: Rebuild.
550
bc3d3e89 5512010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
075f1161 552
bc3d3e89 553 * line-map.h (source_location): Remove obsolete comment
554 mentioning location_s.
555
0d601ff4 5562010-09-29 Kai Tietz <kai.tietz@onevision.com>
557
558 PR preprocessor/45362
559 * directives.c (cpp_pop_definition): Make static.
560 (do_pragma_push_macro): Reworked to store text
561 definition.
562 (do_pragma_pop_macro): Add free text definition.
563 (cpp_push_definition): Removed.
564 * include/cpplib.h (cpp_push_definition): Removed.
565 (cpp_pop_definition): Likewise.
566 * internal.h (def_pragma_macro): Remove member 'value'
567 and add new members 'definition', 'line',
568 'syshdr', 'sued' and 'is_undef'.
569 * pch.c (_cpp_restore_pushed_macros): Rework to work
570 on text definition and store additional macro flags.
571 (_cpp_save_pushed_macros): Likewise.
572
5ae82d58 5732010-09-29 Joseph Myers <joseph@codesourcery.com>
574
575 * include/cpplib.h (cpp_options): Rename warn_deprecated,
576 warn_traditional, warn_long_long and pedantic.
577 * directives.c (directive_diagnostics, _cpp_handle_directive):
578 Update names of cpp_options members.
579 * expr.c (cpp_classify_number, eval_token): Update names of
580 cpp_options members.
581 * init.c (cpp_create_reader, post_options): Update names of
582 cpp_options members.
583 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
584 cpp_options members.
585 * macro.c (parse_params): Update names of cpp_options members.
586
ced52ffd 5872010-09-15 Ian Lance Taylor <iant@google.com>
588
589 * init.c: Fix type name in comment.
590
df863d33 5912010-08-31 Jakub Jelinek <jakub@redhat.com>
592
593 PR preprocessor/45457
594 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
595 needed.
596 * directives.c (do_ifdef, do_ifndef): Likewise.
597
9e76b586 5982010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
599
600 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
601
b315ae35 6022010-08-24 Richard Henderson <rth@redhat.com>
603
604 PR bootstrap/45376
605 * configure.ac (HAVE_SSE4): New check.
606 * configure, config.in: Rebuild.
607 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
608
8ab29ece 6092010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
610
611 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
612 etc. on Solaris 2/x86.
613
2431e8ba 6142010-08-21 Richard Henderson <rth@redhat.com>
615 Andi Kleen <ak@linux.intel.com>
616 David S. Miller <davem@davemloft.net>
617
618 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
619 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
620 (ptrdiff_t): Check via AC_CHECK_TYPE.
621 * config.in, configure: Rebuild.
622 * system.h: Include stdint.h, if available.
623 * lex.c (WORDS_BIGENDIAN): Provide default.
624 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
625 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
626 search_line_sse2, search_line_sse42, init_vectorized_lexer,
627 search_line_fast): New.
628 (_cpp_clean_line): Use search_line_fast. Restructure the fast
629 loop to make it clear when we're leaving the loop. Stay in the
630 fast loop for non-trigraph '?'.
631
25692381 6322010-06-11 Jakub Jelinek <jakub@redhat.com>
633
634 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
635 callback.
636 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
637 (cpp_macro_definition): Remove const qual from second argument.
638 * macro.c (enter_macro_context): Call user_builtin_macro callback for
639 NODE_BUILTIN !NODE_USED macros.
640 (warn_of_redefinition): Likewise. Remove const qual from second
641 argument.
642 (cpp_macro_definition): Likewise.
643 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
644 for NODE_BUILTIN !NODE_USED macros.
645
abf6a617 6462010-06-10 Joseph Myers <joseph@codesourcery.com>
647
648 * include/cpplib.h (struct cpp_options): Remove show_column.
649 * init.c (cpp_create_reader, post_options): Don't set show_column.
650
9d135bb6 6512010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
652
653 PR bootstrap/44432
654 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
655 check that C++ compiler works.
656 * configure: Regenerate.
657
ba72912a 6582010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
659
660 * include/symtab.h (ht_identifier_ptr): New.
661
050318d9 6622010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
663 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
664
665 PR bootstrap/42798
666 * configure.ac: Check for declaration of 'basename(char *)'.
667 * configure: Regenerate.
668 * config.in: Regenerate.
669
39012afb 6702010-04-25 Joseph Myers <joseph@codesourcery.com>
671
672 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
673 * init.c (lang_defaults): Add entries for new language variants.
674 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
675 variants.
676
721e9705 6772010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
678
679 PR cpp/43195
680 * files.c (report_missing_guard): Test for #pragma once.
681
3a79f5da 6822010-04-07 Simon Baldwin <simonb@google.com>
683
684 * directives.c (do_diagnostic): Add warning reason argument,
685 call appropriate error reporting function for code.
686 (directive_diagnostics): Call specific warning functions with
687 warning reason where appropriate.
688 (do_error, do_warning, do_pragma_dependency): Add warning reason
689 argument to do_diagnostic calls.
690 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
691 _cpp_create_definition): Call specific warning functions with
692 warning reason where appropriate.
693 * Makefile.in: Add new diagnostic functions to gettext translations.
694 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
695 to error callback.
696 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
697 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
698 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
699 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
700 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
701 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
702 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
703 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
704 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
705 warning reason codes.
706 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
707 cpp_warning_with_line, cpp_pedwarning_with_line,
708 cpp_warning_with_line_syshdr): New specific error reporting functions.
709 * pch.c (cpp_valid_state): Call specific warning functions with
710 warning reason where appropriate.
711 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
712 diagnostic handlers.
713 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
714 cpp_warning_with_line, cpp_pedwarning_with_line,
715 cpp_warning_with_line_syshdr): New specific error reporting functions.
716 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
717 specific warning functions with warning reason where appropriate.
718 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
719 warn_about_normalization, lex_identifier_intern, lex_identifier,
720 _cpp_lex_direct): Ditto.
721 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
722 narrow_str_to_charconst): Ditto.
723
56e2ce2d 7242010-04-06 Jakub Jelinek <jakub@redhat.com>
725
726 PR preprocessor/43642
727 * lex.c (lex_raw_string): Change type of TYPE variable to
728 unsigned char.
729
e0934084 7302010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
731
732 * aclocal.m4: Regenerate.
733
7fe0ef3a 7342010-03-29 Jason Merrill <jason@redhat.com>
735
3a45011c 736 More N3077 raw string changes
737 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
738 strings.
739 * lex.c (bufring_append): Split out from...
740 (lex_raw_string): ...here. Undo trigraph and line splicing
741 transformations. Do process line notes in multi-line literals.
742 (_cpp_process_line_notes): Ignore notes that were already handled.
743
7fe0ef3a 744 Some raw string changes from N3077
745 * charset.c (cpp_interpret_string): Change inner delimiters to ().
746 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
747
65f40615 7482010-02-11 Jakub Jelinek <jakub@redhat.com>
749
750 * init.c (read_original_filename): Don't call read_original_directory
751 if _cpp_handle_directive returns 0.
752
0074cd57 7532010-01-01 Joseph Myers <joseph@codesourcery.com>
754
755 PR preprocessor/41947
756 * expr.c (cpp_classify_number): Give error for hexadecimal
757 floating-point constant with no digits before or after point.
758
116f0a5f 7592009-11-20 Arnaud Charlet <charlet@adacore.com>
760
761 * macro.c (enter_macro_context): Call cb.used callback if defined.
762 * directives.c (do_idef, do_ifndef): Ditto.
763 * include/cpplib.h (struct cpp_callbacks): Add used callback.
764
038c21f1 7652009-11-11 Kai Tietz <kai.tietz@onevision.com>
766
767 * directives.c (do_pragma_push_macro): New pragma handler.
768 (do_pragma_pop_macro): Likewise.
769 (_cpp_init_internal_pragmas): Add push_macro and
770 pop_macro handler to internal pragmas.
771 (lex_macro_node_from_str): Removed.
772 (cpp_push_definition): Replace lex_macro_node_from_str
773 by _cpp_lex_identifier.
774 (cpp_pop_definition): Likewise.
775 * internal.h (_cpp_lex_identifier): New prototype.
776 (def_pragma_macro): New structure.
777 (cpp_reader): New member pushed_macros.
778 * lex.c (_cpp_lex_identifier): New function.
779 (lex_identifier_intern): New function.
780 * init.c (cpp_create_reader): Initialize pushed_macros
781 member.
782 (cpp_destroy): Free elements in pushed_macros member.
783 * pch.c (_cpp_save_pushed_macros): New function.
784 (_cpp_restore_pushed_macros): Likewise.
785 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
786 (cpp_read_state): Use _cpp_restore_pushed_macros.
787
538ba11a 7882009-10-19 Jakub Jelinek <jakub@redhat.com>
789
790 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
791 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
792 and char32_cset_desc.
793 (converter_for_type): Handle CPP_UTF8STRING.
794 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
795 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
796 (parse_include): Reject raw strings.
797 * include/cpplib.h (CPP_UTF8STRING): New token type.
798 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
799 * lex.c (lex_raw_string): New function.
800 (lex_string): Handle u8 string literals, call lex_raw_string
801 for raw string literals.
802 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
803 sequences.
804 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
805
af4d2883 8062009-10-14 Jakub Jelinek <jakub@redhat.com>
807
808 PR preprocessor/41543
809 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
810 * line-map.c (linemap_init): Initialize highest_location and
811 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
812
8e83a065 8132009-10-09 Jason Merrill <jason@redhat.com>
814
815 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
816
8f2ff12e 8172009-10-09 Neil Vachharajani <nvachhar@google.com>
818
819 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
820 sccs.
821
fc25a827 8222009-09-23 Loren J. Rittle <ljrittle@acm.org>
823
824 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
825 * configure: Rebuilt.
826
fa12a6a5 8272009-09-22 Richard Guenther <rguenther@suse.de>
828
829 PR pch/38987
830 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
831
c25f2689 8322009-09-18 Chris Demetriou <cgd@google.com>
833
834 PR preprocessor/28435:
835 * include/cpplib.h (struct cpp_options): Add new member
836 deps.need_preprocessor_output.
837 * files.c (open_file_failed): If preprocessor output is needed
838 always report an error.
839
a4f7c8f7 8402009-09-13 Kai Tietz <kai.tietz@onevision.com>
841
842 * configure.ac: Set for i?86-w64-mingw*
843 need_64bit_hwint to yes.
844 * configure: Regenerated.
845
3f24af9b 8462009-09-10 Jason Merrill <jason@redhat.com>
847
848 * directives.c (cpp_define): constify.
849
2a50bfcf 8502009-09-02 Ian Lance Taylor <iant@google.com>
851
852 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
853
81a71e2b 8542009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
855
856 * configure.ac (AC_PREREQ): Bump to 2.64.
857
cd9a469c 8582009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
859
860 * aclocal.m4: Regenerate.
861 * config.in: Regenerate.
862 * configure: Regenerate.
863
ed184982 8642009-08-17 Tom Tromey <tromey@redhat.com>
865
866 PR preprocessor/41067:
867 * charset.c (convert_escape): Add missing ":" to error text.
868
7ad75c55 8692009-07-27 Douglas B Rupp <rupp@gnat.com>
870
871 * include/cpplib.h (INO_T_CPP): New macro.
872 (struct cpp_dir): Use it.
873
80b97ef3 8742009-07-20 Jerry Quinn <jlquinn@optonline.net>
875
876 PR regression/40800
877 * configure.ac: Use = instead of == for testing
878 ENABLE_BUILD_WITH_CXX.
879 * configure: Rebuild.
880
723ebaea 8812009-07-17 Jerry Quinn <jlquinn@optonline.net>
882
883 * directives.c (do_linemarker, do_line): Use CPP_STRING for
884 ignored enum value.
885 * files.c (find_file_in_dir): Add cast from void* to char*.
886 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
887 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
888 warnings.
889 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
890 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
891 COMPILER_FLAGS): New.
892 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
893 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
894 instead of ALL_CFLAGS.
895 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
896 from other warnings. Add -Wc++-compat to C-specific warnings.
897 Check for --enable-build-with-cxx. Set and substitute
898 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
899 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
900 AC_CHECK_HEADERS.
901 * configure: Rebuild.
902 * include/cpp-id-data.h: Remove extern "C".
903 * include/line-map.h: Likewise.
904 * include/mkdeps.h: Likewise.
905 * include/symtab.h: Likewise.
906 * internal.h: Likewise.
907
78ed8e3d 9082009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
909
910 * directives.c (parse_include): Add location argument. Update all
911 calls.
912 (parse_answer): Likewise.
913 (do_include_common): Error with exact location.
914 (parse_assertion): Likewise.
915
46821594 9162009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
917
918 * expr.c (num_div_op): Take explicit location.
919
52b290f1 9202009-06-17 Ian Lance Taylor <iant@google.com>
921
922 * include/cpplib.h (progname): Don't declare.
923
2a6a6991 9242009-06-12 Ian Lance Taylor <iant@google.com>
925
926 * include/cpplib.h (struct cpp_options): Add
927 warn_cxx_operator_names field.
928 (NODE_WARN_OPERATOR): Define.
929 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
930 type to 6 bits.
931 * init.c (mark_named_operators): Add flags parameter.
932 (cpp_post_options): Pick flags value to pass to
933 mark_named_operators.
934 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
935 identifier is an operator name in C++.
936
b559b9e2 9372009-06-01 Aldy Hernandez <aldyh@redhat.com>
938
939 * include/line-map.h (LAST_SOURCE_COLUMN): New.
940
e61157d7 9412009-06-01 Ian Lance Taylor <iant@google.com>
942
943 * include/cpp-id-data.h: Add extern "C".
944 * include/line-map.h: Likewise.
945 * include/mkdeps.h: Likewise.
946 * include/symtab.h: Likewise.
947 * internal.h: Likewise.
948
26dbec0a 9492009-05-15 Ian Lance Taylor <iant@google.com>
950
951 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
952 builtin_type. Change all uses.
953
5b500807 9542009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
955
956 PR cpp/36674
957 * directives (do_linemarker): Compensate for the increment in
958 location that occurs when we reach the end of line.
959 * files (_cpp_stack_include): Mention _cpp_find_file in the
960 comment.
961
2ee04baa 9622009-05-10 Joseph Myers <joseph@codesourcery.com>
963
964 * include/cpplib.h (enum cpp_token_fld_kind): Add
965 CPP_TOKEN_FLD_TOKEN_NO.
966 (struct cpp_macro_arg, struct cpp_identifier): Define.
967 (union cpp_token_u): Use struct cpp_identifier for identifiers.
968 Use struct cpp_macro_arg for macro arguments. Add token_no for
969 CPP_PASTE token numbers.
970 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
971 do_pragma_poison, parse_assertion): Use val.node.node in place of
972 val.node.
973 * expr.c (parse_defined, eval_token): Use val.node.node in place
974 of val.node.
975 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
976 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
977 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
978 place of val.arg_no. Use val.node.node in place of val.node.
979 * macro.c (replace_args, cpp_get_token, parse_params,
980 lex_expansion_token, create_iso_definition, cpp_macro_definition):
981 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
982 Use val.node.node in place of val.node.
983
49a657d9 9842009-05-03 Joseph Myers <joseph@codesourcery.com>
985
986 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
987 UTF-8 sequences.
988
9c6183dd 9892009-04-25 Joseph Myers <joseph@codesourcery.com>
990
991 PR preprocessor/39559
992 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
993 constants larger than intmax_t in C99 mode.
994
fb1e4f4a 9952009-04-21 Taras Glek <tglek@mozilla.com>
996
997 * include/cpp-id-data.h: Update GTY annotations to new syntax.
998 * include/cpplib.h: Likewise.
999 * include/line-map.h: Likewise.
1000 * include/symtab.h: Likewise.
1001
ba99525e 10022009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1003
1004 PR c++/14875
1005 * lex.c (cpp_type2name): Take a flags parameter. Call
1006 cpp_named_operator2name for named operators and cpp_digraph2name
1007 for digraphs.
1008 (cpp_digraph2name): New.
1009 (cpp_spell_token): Use it.
1010 (cpp_output_token): Likewise.
1011 * include/cpplib.h (cpp_type2name): Update declaration.
1012 * init.c (cpp_named_operator2name): New.
1013 * internal.h (cpp_named_operator2name): Declare.
1014
9ab71c6b 10152009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1016
1017 PR c++/13358
1018 * init.c (cpp_create_reader): Wlong_long is disabled by default.
1019 * expr.c (cpp_classify_number): Give different messages for C and
1020 C++ front-ends.
1021
941f2388 10222009-04-19 Joseph Myers <joseph@codesourcery.com>
1023
1024 PR preprocessor/20078
1025 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
1026 field.
1027 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
1028 (struct cpp_token): Change flags to unsigned short.
1029 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
1030 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
1031 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
1032 tokens.
1033 * macro.c (macro_real_token_count): New.
1034 (enter_macro_context, replace_args): Use macro_real_token_count.
1035 (create_iso_definition): Record whitespace surrounding and digraph
1036 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
1037 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
1038 multiple consecutive ## tokens.
1039 (_cpp_create_definition): Initialize extra_tokens.
1040 (cpp_macro_definition): Use macro_real_token_count.
1041
3e52c418 10422009-04-18 Joseph Myers <joseph@codesourcery.com>
1043
1044 * directives.c (parse_include): Pass true to check_eol.
1045
1eecdb28 10462009-04-18 Joseph Myers <joseph@codesourcery.com>
1047
1048 PR preprocessor/39646
1049 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
1050 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
1051 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
1052 place of LC_RENAME.
1053
6cda323a 10542009-04-18 Joseph Myers <joseph@codesourcery.com>
1055
1056 PR preprocessor/39647
1057 * directives.c (check_eol): Add parameter expand.
1058 (do_undef, parse_include, do_line, do_linemarker, do_ident,
1059 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
1060 do_else, do_endif, do_assert, do_unassert): All callers changed.
1061 Pass true from do_line, false elsewhere.
1062
e21164ef 10632009-04-12 Joseph Myers <joseph@codesourcery.com>
1064
1065 PR preprocessor/31869
1066 * macro.c (stringify_arg): Handle NULL source token in padding
1067 token where previous padding token did not have source token with
1068 preceding whitespace.
1069
6bc9506f 10702009-04-09 Jakub Jelinek <jakub@redhat.com>
1071
1072 * Makefile.in: Change copyright header to refer to version
1073 3 of the GNU General Public License and to point readers at the
1074 COPYING3 file and the FSF's license web page.
1075 * charset.c: Likewise.
1076 * directives-only.c: Likewise.
1077 * directives.c: Likewise.
1078 * errors.c: Likewise.
1079 * expr.c: Likewise.
1080 * files.c: Likewise.
1081 * identifiers.c: Likewise.
1082 * include/cpp-id-data.h: Likewise.
1083 * include/cpplib.h: Likewise.
1084 * include/line-map.h: Likewise.
1085 * include/mkdeps.h: Likewise.
1086 * include/symtab.h: Likewise.
1087 * init.c: Likewise.
1088 * internal.h: Likewise.
1089 * lex.c: Likewise.
1090 * line-map.c: Likewise.
1091 * macro.c: Likewise.
1092 * makeucnid.c: Likewise.
1093 * mkdeps.c: Likewise.
1094 * pch.c: Likewise.
1095 * symtab.c: Likewise.
1096 * system.h: Likewise.
1097 * traditional.c: Likewise.
1098 * ucnid.tab: Likewise.
1099 * ucnid.h: Regenerate.
1100
5840fdcf 11012009-04-01 Janis Johnson <janis187@us.ibm.com>
1102
f8ed6d41 1103 PR c/39027
1104 * include/cpplib.h (CPP_N_DEFAULT): Define.
1105 * expr.c (interpret_float_suffix): Recognize d or D for double,
1106 return new value for default.
1107 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
1108
5840fdcf 1109 PR c/33466
1110 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
1111 letters from decimal float and fixed-point suffixes.
1112
ff903809 11132009-03-31 Joseph Myers <joseph@codesourcery.com>
1114
1115 PR preprocessor/15638
1116 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
1117 invalid PCH.
1118 (open_file_failed): Make error for missing file fatal.
1119 * include/cpplib.h (CPP_DL_FATAL): Define.
1120
bfba65a4 11212009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
1122
1123 PR preprocessor/31932:
1124 * internal.h: Don't mention HAVE_ICONV_H.
1125 * configure, config.in: Rebuild.
1126 * configure.ac: Don't check for iconv.h.
1127
102a7306 11282009-03-30 Tom Tromey <tromey@redhat.com>
1129
1130 PR preprocessor/39512:
1131 * line-map.c (linemap_init): Initialize 'reallocator' field.
1132
4514949a 11332009-03-30 Jakub Jelinek <jakub@redhat.com>
1134
1135 PR target/39558
1136 * macro.c (cpp_get_token): If macro_to_expand returns NULL
1137 and used some tokens, add CPP_PADDING before next token.
1138
7f5f3953 11392009-03-29 Joseph Myers <joseph@codesourcery.com>
1140
1141 PR preprocessor/34695
1142 * makedepend.c: Remove.
1143 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
1144 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
1145 * directives.c (cpp_errors): Remove.
1146 * errors.c (print_location, _cpp_begin_message, v_message):
1147 Remove.
1148 (cpp_error, cpp_error_with_line): Always use error callback.
1149 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
1150 * include/cpplib.h (cpp_options): Remove pedantic_errors,
1151 inhibit_warnings, warn_system_headers, inhibit_errors,
1152 warnings_are_errors, client_diagnostic.
1153 (cpp_callbacks): Add extra arguments to error callback; make it
1154 return bool.
1155 (cpp_finish): Return void.
1156 (cpp_destroy): Remove inaccurate comment about return value.
1157 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
1158 (CPP_DL_NOTE): Define.
1159 * include/line-map.h (linemap_print_containing_files): Remove.
1160 * init.c (cpp_finish): Do not check for or return number of
1161 errors.
1162 * internal.h (cpp_reader): Remove errors field.
1163 * line-map.c (linemap_print_containing_files): Remove.
1164 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
1165 about previous definition. Only emit it if previous diagnostic
1166 was emitted.
1167
d5a78dd0 11682009-03-28 Joseph Myers <joseph@codesourcery.com>
1169
1170 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
1171 mkinstalldirs.
1172
0ac758f7 11732009-03-18 Jakub Jelinek <jakub@redhat.com>
1174
1175 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
1176
7811eab5 11772009-02-21 Joseph Myers <joseph@codesourcery.com>
1178
1179 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
1180 header name.
1181 (_cpp_lex_direct): Handle this.
1182
b5c49426 11832009-02-15 Richard Guenther <rguenther@suse.de>
1184
1185 Revert last change.
1186
76549266 11872009-02-13 Richard Guenther <rguenther@suse.de>
1188
1189 * configure.ac: Enable LFS.
1190 * configure: Re-generate.
1191 * config.in: Likewise.
1192
e7ae053d 11932009-01-05 Ben Elliston <bje@au.ibm.com>
1194
1195 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
1196 (.po.pox): Likewise.
1197 (po/$(PACKAGE).pot): Likewise.
1198
c1203b1c 11992008-12-10 Alexandre Oliva <aoliva@redhat.com>
1200
1201 PR target/37033
1202 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
1203 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
1204
cd740bd5 12052008-11-29 Joseph Myers <joseph@codesourcery.com>
1206
1207 * lex.c (cpp_token_len): Use 6 as default length.
1208
ae5c166d 12092008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
1210
1211 * expr.c (struct op): Add location.
1212 (_cpp_parse_expr): Propagate locations throught the stack
1213 of expressions.
1214 (reduce): Likewise.
1215 (check_promotion): Use explicit location in errors.
1216
956c6108 12172008-10-05 Matthew Gingell <gingell@adacore.com>
1218 Arnaud Charlet <charlet@adacore.com>
1219
1220 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
1221 (cpp_get_comments): New function.
1222 * internal.h (struct cpp_reader): Add comments field.
1223 * init.c (cpp_destroy): Free comments.
1224 * lex.c (store_comment, cpp_get_comments): New functions.
1225 (comments): New struct.
1226 (save_comment): Store comments in comments struct.
1227
2ad0b097 12282008-09-18 Simon Baldwin <simonb@google.com>
1229
1230 * include/cpplib.h (struct cpp_options): Add new boolean flag
1231 warn_builtin_macro_redefined.
1232 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
1233 * (struct builtin_operator): Split out from previous struct builtin,
1234 enhance extra const correctness.
1235 * (struct builtin_macro): Split out from previous struct builtin, add
1236 new always_warn_if_redefined flag, enhance const correctness.
1237 * (mark_named_operators): Use struct builtin_operator.
1238 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
1239 to builtins selectively.
1240 * macro.c (warn_of_redefinition): Return false if a builtin macro
1241 is not flagged with NODE_WARN.
1242
408c2285 12432008-07-31 Jakub Jelinek <jakub@redhat.com>
1244
1245 PR preprocessor/36649
1246 * files.c (struct report_missing_guard_data): New type.
1247 (report_missing_guard): Put paths into an array instead of printing
1248 them right away. Return 1 rather than 0.
1249 (report_missing_guard_cmp): New function.
1250 (_cpp_report_missing_guards): Sort and print paths gathered by
1251 report_missing_guard callback.
1252
98e29890 12532008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1254
1255 PR 28079
1256 * directives.c (strtolinenum): Handle overflow.
1257 (do_line): Give a warning if line number overflowed.
1258 (do_linemarker): Update call to strtolinenum.
1259
4999c35b 12602008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1261
1262 * include/line-map.h (linenum_type): New typedef.
1263 (struct line_map): Use it.
1264 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
1265 (SOURCE_COLUMN): Likewise.
1266 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
1267 source_location values in a variable of type linenum_type.
1268 * directives.c (struct if_stack): Use linenum_type.
1269 (strtoul_for_line): Rename as strtolinenum.
1270 (do_line): Use linenum_type.
1271 (do_linemarker): Use linenum_type and strtolinenum.
1272 (_cpp_do_file_change): Use linenum_t.
1273 * line-map.c (linemap_add): Likewise.
1274 (linemap_line_start): Likewise.
1275 * traditional.c (struct fun_macro): 'line' is a source_location.
1276 * errors.c (print_location): Use linenum_type.
1277 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
1278 * internal.h (CPP_INCREMENT_LINE): Likewise.
1279 * lex.c (_cpp_skip_block_comment): Use source_location.
1280
89768577 12812008-07-14 Ben Elliston <bje@au.ibm.com>
1282
1283 * include/cpplib.h (NODE_CONDITIONAL): New.
1284 (struct cpp_callbacks): New macro_to_expand field.
1285 (struct cpp_hashnode): Adjust size of flags and type fields.
1286 (cpp_peek_token): Prototype.
1287 * lex.c (cpp_peek_token): New function.
1288 (_cpp_temp_token): Protect pre-existing lookaheads.
1289 * macro.c (cpp_get_token): Expand any conditional macros.
1290 (_cpp_backup_tokens_direct): New.
1291 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
1292 (warn_of_redefinition): Silently allow redefined conditional
1293 macros.
1294 (_cpp_create_definition): Remove the conditional flag when a user
1295 defines one of the conditional macros.
1296 * internal.h (_cpp_backup_tokens_direct): New prototype.
1297
403c2b12 12982008-06-13 Andrew Haley <aph@redhat.com>
1299
1300 PR preprocessor/33305
1301 * macro.c (replace_args): Print a warning for empty macro
1302 arguments in C89 and C++.
1303
5b2c7553 13042008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1305
1306 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
1307 * configure: Regenerate.
1308
b9de6413 13092008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1310
1311 * Makefile.in (datarootdir): New variable.
1312
bfa57d81 13132008-06-12 H.J. Lu <hongjiu.lu@intel.com>
1314
1315 PR preprocessor/36479
1316 * charset.c (cpp_interpret_string_notranslate): Also set
1317 narrow_cset_desc.width.
1318
6af9f7ea 13192008-06-07 Joseph Myers <joseph@codesourcery.com>
1320
1321 * configure.ac (parisc*64*-*-*): Remove.
1322 * configure: Regenerate.
1323
536a48ee 13242008-05-30 Tom Tromey <tromey@redhat.com>
1325
1326 PR preprocessor/36320:
1327 * internal.h (_cpp_parse_expr): Update.
1328 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
1329 messages.
1330 * directives.c (do_if): Update.
1331 (do_elif): Require expression if processing group.
1332
f4d02485 13332008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
1334
1335 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
1336
c0770282 13372008-05-21 Tom Tromey <tromey@redhat.com>
1338
1339 PR preprocessor/27777:
1340 * lex.c (cpp_output_line_to_string): New function.
1341 * internal.h (_cpp_begin_message): Don't declare.
1342 * errors.c (_cpp_begin_message): Now static.
1343 * include/cpplib.h (cpp_output_line_to_string): Declare.
1344 * directives.c (do_diagnostic): Rewrote. Use
1345 cpp_output_line_to_string. Don't use _cpp_begin_message.
1346
dfecde36 13472008-05-21 Tom Tromey <tromey@redhat.com>
1348
1349 * include/symtab.h (HT_ALLOCED): Remove.
1350 (ht_purge): Declare.
1351 * symtab.c (DELETED): New define.
1352 (ht_lookup): Update comment.
1353 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
1354 code. Use subobject allocator for strings, if it exists.
1355 (ht_expand): Handle deleted entries.
1356 (ht_forall): Likewise.
1357 (ht_purge): New function.
1358 (ht_dump_statistics): Print deletion statistics.
1359
fb9753dc 13602008-05-13 Tom Tromey <tromey@redhat.com>
1361
1362 PR preprocessor/22168:
1363 * include/cpplib.h (struct cpp_options) <objc>: Update
1364 documentation.
1365 * expr.c (eval_token): Warn for use of assertions.
1366 * directives.c (directive_diagnostics): Warn about extensions.
1367 (DEPRECATED): New define.
1368 (DIRECTIVE_TABLE): Use it.
1369
151e90cc 13702008-05-06 Tom Tromey <tromey@redhat.com>
1371
1372 PR preprocessor/35313, PR preprocessor/36088:
1373 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
1374 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
1375
2cd62354 13762008-05-04 David S. Miller <davem@davemloft.net>
1377
1378 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
1379 * configure: Regenerate.
1380
85e51d59 13812008-04-22 Daniel Franke <franke.daniel@gmail.com>
1382
1383 * include/cpplib.h (cpp_define_formatted): New.
1384 * directives.c (cpp_define_formatted): New.
1385
d656d07a 13862008-04-21 Tom Tromey <tromey@redhat.com>
1387
1388 PR libcpp/33415:
1389 * charset.c (_cpp_convert_input): Add buffer_start argument.
1390 Ignore UTF-8 BOM if seen.
1391 * internal.h (_cpp_convert_input): Add argument.
1392 * files.c (struct _cpp_file) <buffer_start>: New field.
1393 (destroy_cpp_file): Free buffer_start, not buffer.
1394 (_cpp_pop_file_buffer): Likewise.
1395 (read_file_guts): Update.
1396
924bbf02 13972008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1398
1399 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
1400 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
1401 (struct cpp_options): Added uliterals.
1402 (cpp_interpret_string): Update prototype.
1403 (cpp_interpret_string_notranslate): Idem.
1404 * charset.c (init_iconv_desc): New width member in cset_converter.
1405 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
1406 (convert_ucn): Idem.
1407 (emit_numeric_escape): Idem.
1408 (convert_hex): Idem.
1409 (convert_oct): Idem.
1410 (convert_escape): Idem.
1411 (converter_for_type): New function.
1412 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
1413 (cpp_interpret_string_notranslate): Match changed prototype.
1414 (wide_str_to_charconst): Use converter_for_type.
1415 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
1416 * directives.c (linemarker_dir): Macro U changed to UC.
1417 (parse_include): Idem.
1418 (register_pragma_1): Idem.
1419 (restore_registered_pragmas): Idem.
1420 (get__Pragma_string): Support CPP_STRING{16,32}.
1421 * expr.c (eval_token): Support CPP_CHAR{16,32}.
1422 * init.c (struct lang_flags): Added uliterals.
1423 (lang_defaults): Idem.
1424 * internal.h (struct cset_converter) <width>: New field.
1425 (struct cpp_reader) <char16_cset_desc>: Idem.
1426 (struct cpp_reader) <char32_cset_desc>: Idem.
1427 * lex.c (digraph_spellings): Macro U changed to UC.
1428 (OP, TK): Idem.
1429 (lex_string): Add support for u'...', U'...', u"..." and U"...".
1430 (_cpp_lex_direct): Idem.
1431 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
1432 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
1433
6a88da51 14342008-04-18 Paolo Bonzini <bonzini@gnu.org>
1435
1436 PR bootstrap/35457
1437 * aclocal.m4: Regenerate.
1438 * configure: Regenerate.
1439
6e6d82ef 14402008-04-17 Tom Tromey <tromey@redhat.com>
1441
1442 PR libcpp/34866:
1443 * errors.c (cpp_error): Don't reference a token before the start
1444 of the current run.
1445
f521616b 14462008-04-16 Tom Tromey <tromey@redhat.com>
1447
1448 * Makefile.in (TAGS_SOURCES): New variable.
1449 (TAGS): New target.
1450
fc7383ad 14512008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
1452
1453 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
1454 and shbe-*-*.
1455 * configure: Rebuilt.
1456
34c3de48 14572008-04-02 Joseph Myers <joseph@codesourcery.com>
1458
1459 * include/cpplib.h (struct cpp_callbacks): Add used_define,
1460 used_undef and before_define.
1461 (NODE_USED): Define.
1462 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
1463 do_ifndef, cpp_pop_definition): Handle new flag and use new
1464 callbacks.
1465 * expr.c (parse_defined): Handle new flag and use new callbacks.
1466 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
1467 flag and use new callbacks.
1468
f2225b1a 14692008-04-01 Jakub Jelinek <jakub@redhat.com>
1470
1471 PR pch/13675
1472 * files.c (struct _cpp_file): Remove pch field.
1473 (pch_open_file): Don't set file->pch, just file->pchname.
1474 (should_stack_file): After pfile->cb.read_pch call
1475 free pchname and clear pchname, don't close file->fd.
1476 Test file->pchname instead of file->pch. Don't close fd after cb.
1477 (_cpp_stack_include): Test file->pchname instead of file->pch.
1478
5a959782 14792008-03-28 Tom Tromey <tromey@redhat.com>
1480
1481 * Makefile.in (POSTCOMPILE): New variable.
1482 (.c.o): Use it.
1483
8302ff7f 14842008-03-13 Tom Tromey <tromey@redhat.com>
1485
1486 PR libcpp/35322:
1487 * directives.c (destringize_and_run): Set pfile->directive.
1488
8bd452d9 14892008-03-06 Markus Milleder <markus.milleder@generali.at>
1490
1491 PR preprocessor/35458
1492 * mkdeps.c (munge): Quote '#' with a '\'.
1493
0c62b06e 14942008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1495
1496 PR preprocessor/35379
1497 * mkdeps.c (deps_write): Ensure the first target always appears
1498 in the first column, without leading backslash newline. Avoid
1499 some more extra whitespace.
1500
6b0c1373 15012008-02-25 Thiemo Seufer <ths@mips.com>
1502
0c62b06e 1503 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
6b0c1373 1504
e297899b 15052008-02-19 Tom Tromey <tromey@redhat.com>
1506
1507 * traditional.c (lex_identifier): Use CPP_HASHNODE.
1508 * lex.c (lex_identifier): Use CPP_HASHNODE.
1509 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
1510 do-while.
1511 * identifiers.c (alloc_node): Change return type.
1512 (_cpp_init_hashtable): Don't cast 'alloc_node'.
1513 (proxy_assertion_broken): New declaration.
1514 (cpp_forall_identifiers): Move comment.
1515 * line-map.c (linemap_add): Comment fix.
1516 (linemap_line_start): Indentation fix.
1517
45f9f140 15182008-01-25 Jakub Jelinek <jakub@redhat.com>
1519
1520 PR preprocessor/34692
1521 * macro.c (collect_args): Add pragma_buff argument. Push
1522 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
1523 than into arguments. Reset prevent_expansion and parsing_args
1524 state at CPP_PRAGMA_EOL/CPP_EOF.
1525 (funlike_invocation_p): Add pragma_buff argument, pass it through
1526 to collect_args.
1527 (enter_macro_context): Add result argument. Adjust
1528 funlike_invocation_p caller. Emit all deferred pragma tokens
1529 gathered during collect_args before the expansion, add a padding
1530 token. Return 2 instead of 1 if any pragma tokens were prepended.
1531 (cpp_get_token): If enter_macro_context returns 2, don't return
1532 a padding token, instead cycle to grab CPP_PRAGMA token.
1533 * directives.c (_cpp_handle_directive): If was_parsing_args
1534 in deferred pragma, leave parsing_args and prevent_expansion as is.
1535
a56d0856 15362008-01-22 Tom Tromey <tromey@redhat.com>
1537
45f9f140 1538 PR c++/34859
a56d0856 1539 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
1540 __STDC_CONSTANT_MACROS.
1541
7a1a608c 15422008-01-07 Fred Fish <fnf@specifix.com>
1543
45f9f140 1544 PR preprocessor/30363
7a1a608c 1545 * traditional.c (replace_args_and_push): Add local variable
1546 cxtquote, calculate the replacement text size assuming a
1547 worst case of every input character quoted with backslash,
1548 and properly handle output quoting of quote characters in
1549 actual arguments used in function-like macros.
1550
cde59b72 15512008-01-03 Tom Tromey <tromey@redhat.com>
1552
45f9f140 1553 PR preprocessor/34602
cde59b72 1554 * directives.c (do_line): Don't try to spell EOF token.
1555 (do_linemarker): Add comment.
1556
2d1f9589 15572007-12-11 DJ Delorie <dj@redhat.com>
1558
1559 * charset.c (convert_using_iconv): Close out any shift states,
1560 returning to the initial state.
1561
64cb8c90 15622007-12-06 Tom Tromey <tromey@redhat.com>
1563
45f9f140 1564 PR c/29172
64cb8c90 1565 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
1566 type.
1567 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
1568 * files.c (FILE_HASH_POOL_SIZE): New macro.
1569 (struct file_hash_entry_pool): New.
1570 (destroy_all_cpp_files): New function.
1571 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
1572 (new_file_hash_entry): Update.
1573 (free_file_hash_entries): New function.
1574 (_cpp_cleanup_files): Call free_file_hash_entries and
1575 destroy_all_cpp_files.
1576 (cpp_clear_file_cache): New function.
1577 * include/cpplib.h (cpp_clear_file_cache): Declare.
1578
d08a0ab3 15792007-12-03 Tom Tromey <tromey@redhat.com>
1580
45f9f140 1581 PR preprocessor/34288
d08a0ab3 1582 * configure.ac, config.in: Rebuilt.
1583 * configure.ac: Check for ssize_t.
1584
5eb3761c 15852007-11-30 Tom Tromey <tromey@redhat.com>
1586
45f9f140 1587 PR preprocessor/32868
5eb3761c 1588 * macro.c (_cpp_create_definition): Special case
1589 __STDC_FORMAT_MACROS.
1590
bce619a6 15912007-11-16 Michael Matz <matz@suse.de>
1592
1593 * files.c (search_path_head): Fix check for absolute paths.
1594
67015c73 15952007-11-11 Tom Tromey <tromey@redhat.com>
1596
45f9f140 1597 PR c++/17557
67015c73 1598 * include/cpplib.h (cpp_included_before): Declare.
1599 * files.c (struct file_hash_entry) <location>: New field.
1600 (_cpp_find_file): Initialize new field.
1601 (make_cpp_dir): Likewise.
1602 (cpp_included_before): New function.
1603
1991d8eb 16042007-11-01 Tom Tromey <tromey@redhat.com>
1605
45f9f140 1606 PR preprocessor/30805
1991d8eb 1607 * macro.c (paste_tokens): Handle padding token.
1608 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
1609
2d507e67 16102007-10-31 Tom Tromey <tromey@redhat.com>
1611
45f9f140 1612 PR preprocessor/30786
2d507e67 1613 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
1614 * directives.c (_cpp_do__Pragma): Return error status.
1615 * internal.h (_cpp_do__Pragma): Update.
1616 * directives.c (get__Pragma_string): Back up if EOF seen.
1617
931b0a0f 16182007-09-06 Tom Tromey <tromey@redhat.com>
1619
1620 * internal.h (struct cpp_reader) <invocation_location>: New
1621 field.
1622 (struct cpp_reader) <set_invocation_location>: Likewise.
1623 * init.c (cpp_set_line_map): New function.
1624 * line-map.c (linemap_add): Use linemap's allocator.
1625 * include/line-map.h (GTY): Define.
1626 (line_map_realloc): New typedef.
1627 (struct line_map): Mark with GTY.
1628 (struct line_maps): Likewise.
1629 (struct line_maps) <maps>: Likewise.
1630 (struct line_maps) <reallocator>: New field.
1631 * include/symtab.h (GTY): Conditionally define.
1632 * include/cpplib.h (cpp_set_line_map): Declare.
1633 (cpp_get_token_with_location): Declare.
1634 * macro.c (cpp_get_token): Set invocation_location on the reader.
1635 (cpp_get_token_with_location): New function.
1636
84373723 16372007-08-30 Chao-ying Fu <fu@mips.com>
1638
1639 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
1640 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
1641 (cpp_classify_number): Support decimal fixed-point constants without
1642 exponents.
1643 Warn about fixed-point constants when -pedantic.
1644 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
1645 comments to support fixed-point values.
1646 (CPP_N_FRACT, CPP_N_ACCUM): Define.
1647
36ec4203 16482007-08-18 Tom Tromey <tromey@redhat.com>
1649
45f9f140 1650 PR preprocessor/32974
36ec4203 1651 * directives.c (parse_include): Don't check for EOL when
1652 processing #pragma dependency.
1653
fcde64dc 16542007-07-30 Ollie Wild <aaw@google.com>
1655
1656 * directives-only.c: New file.
1657 * internal.h (struct _cpp_dir_only_callbacks): New.
1658 (_cpp_preprocess_dir_only): New function.
1659 * directives.c (_cpp_handle_directive): Check directives_only before
1660 disabling execution of indented directives.
1661 * files.c (_cpp_stack_file): Add directives_only check.
1662 * include/cpplib.h (struct cpp_options): Add directives_only.
1663 (cpp_init_special_builtins): New function.
1664 * init.c (cpp_init_special_builtins): New function.
1665 (cpp_init_builtins): Move builtin_array initialization to
1666 cpp_init_special_builtins.
1667 (post_options): Check directives_only before setting
1668 pfile->state.prevent_expansion = 1.
1669 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
1670 is expanded inside a directive while -fdirectives-only is enabled.
1671 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
1672 (libcpp_a_SOURCES): Add directives-only.c.
1673
ddedd1e1 16742007-07-04 Uros Bizjak <ubizjak@gmail.com>
1675
1676 * traditional.c (_cpp_scan_out_logical_line): Initialize
1677 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
1678 fmacro.args to prevent 'may be used uninitialized' warning.
1679
430be8e2 16802007-07-03 Uros Bizjak <ubizjak@gmail.com>
1681
1682 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
1683 Add new constants.
1684 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
1685 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
1686 for 'q' or 'Q' suffixes.
1687
909dc303 16882007-06-17 Danny Smith <dannysmith@users.sourceforge.net
1689
857d7d5e 1690 * files.c (open_file): Correct typo.
909dc303 1691
7d6f49d6 16922007-06-16 Vladimir Prus <vladimir@codesourcery.com>
1693
857d7d5e 1694 * files.c (open_file): Prevent the call
7d6f49d6 1695 for stat from overwriting errno.
1696
be21d64c 16972007-06-09 Vladimir Prus <vladimir@codesourcery.com>
1698
857d7d5e 1699 * files.c (open_file): Account for the
be21d64c 1700 fact that on windows, opening a directory gives
1701 EACCES.
1702
d7282a2b 17032007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
1704
1705 PR preprocessor/23479
1706 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
1707 integer constants.
1708 (append_digit): Likewise.
1709 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
1710 binary integer constants.
1711
0448520c 17122007-05-31 Dave Korn <dave.korn@artimi.com>
1713
1714 PR preprocessor/14331
1715 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
1716
ce079f70 17172007-05-24 Ollie Wild <aaw@google.com>
1718
1719 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
1720 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
1721 (cpp_write_pch_state): Save __COUNTER__ state.
1722 (cpp_valid_state): Check valid __COUNTER__ state.
1723 (cpp_read_state): Read new __COUNTER__ state.
1724 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
1725 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
1726 * internal.h (struct cpp_reader): Add counter member.
1727
3b6c638e 17282007-05-23 Simon Martin <simartin@users.sourceforge.net>
1729
1730 PR preprocessor/20077
1731 * macro.c (create_iso_definition): Fixed the method to determine
1732 whether the token-pasting operator appears at the beginning or the end
1733 of a macro.
1734
248dfc42 17352007-05-21 Ian Lance Taylor <iant@google.com>
1736
1737 * internal.h (struct cpp_reader): Add new fields:
1738 nonexistent_file_hash and nonexistent_file_ob.
1739 * files.c: Include "obstack.h".
1740 (find_file_in_dir): Before trying to open the file, look up the
1741 path name in the hash table of nonexistent files. After failing
1742 to open the file, add the path name to the hash table.
1743 (_cpp_find_file): Cache the results of looking up the file name
1744 starting with the quote and bracket chain heads, if we can.
1745 (nonexistent_file_hash_eq): New static function.
1746 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
1747 pfile->nonexistent_file_ob.
1748 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
1749 pfile->nonexistent_file_ob.
1750
c55e2f1b 17512007-05-14 Janis Johnson <janis187@us.ibm.com>
1752
5c00409a 1753 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
1754
c55e2f1b 1755 PR c/31924
1756 * expr.c (interpret_float_suffix): Check for invalid suffix.
1757
dd97b5e4 17582007-05-02 Eric Christopher <echristo@apple.com>
1759
1760 * expr.c (num_div_op): Don't overflow if the result is
1761 zero.
1762
3127c357 17632007-05-02 Tom Tromey <tromey@redhat.com>
1764
45f9f140 1765 PR preprocessor/28709
3127c357 1766 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
1767
f23c2abe 17682007-03-30 Michael Meissner <michael.meissner@amd.com>
1769
1770 * directives.c (lex_macro_node_from_str): Fix alloca call to be
1771 type correct.
1772
3fa3949d 17732007-03-30 Richard Henderson <rth@redhat.com>
1774
1775 * directives.c (lex_macro_node_from_str): New.
1776 (cpp_push_definition, cpp_pop_definition): New.
1777 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
1778
7262ccd6 17792007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
1780
1781 * Makefile.in: Add dummy install-pdf target.
1782
09edb0e9 17832007-01-30 Tom Tromey <tromey@redhat.com>
1784
45f9f140 1785 PR preprocessor/30468
09edb0e9 1786 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
1787 './'.
1788
e0ff7935 17892007-01-30 Tom Tromey <tromey@redhat.com>
1790
45f9f140 1791 PR preprocessor/29966
e0ff7935 1792 * macro.c (lex_expansion_token): Save and restore cpp_reader's
1793 cur_token.
1794 (_cpp_create_definition): Don't restore cur_token here.
1795 * lex.c (_cpp_lex_token): Added assertion.
1796
87d210c3 17972007-01-27 Tom Tromey <tromey@redhat.com>
1798
1799 * configure: Rebuilt.
1800
3e2a04b5 18012007-01-12 Tom Tromey <tromey@redhat.com>
1802
45f9f140 1803 PR preprocessor/28227
3e2a04b5 1804 * directives.c (lex_macro_node): Added 'is_def_or_undef'
1805 argument.
1806 (do_define): Update.
1807 (do_undef): Update.
1808 (do_ifdef): Update.
1809 (do_ifndef): Update.
1810
6a6e7e2f 18112007-01-11 Paolo Bonzini <bonzini@gnu.org>
1812
1813 * configure: Regenerate.
1814
77258a2e 18152007-01-11 Paolo Bonzini <bonzini@gnu.org>
1816
1817 * configure: Regenerate.
1818
927b511f 18192007-01-04 Tom Tromey <tromey@redhat.com>
1820
45f9f140 1821 PR preprocessor/28165
927b511f 1822 * internal.h (cpp_in_primary_file): New function.
1823 * directives.c (do_include_next): Use cpp_in_primary_file.
1824 (do_pragma_once): Likewise.
1825 (do_pragma_system_header): Likewise.
1826
5008f5c5 18272006-12-29 Ian Lance Taylor <iant@google.com>
1828
1829 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
1830 look backward at the end of the line unless we saw a backslash.
1831
5d70627e 18322006-12-29 Jakub Jelinek <jakub@redhat.com>
1833
1834 PR preprocessor/29612
1835 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
1836 only when new_sysp is non-zero.
1837
854f075e 18382006-12-28 Tom Tromey <tromey@redhat.com>
1839
45f9f140 1840 PR preprocessor/30001
854f075e 1841 * charset.c (_cpp_convert_input): Check that to.len is greater
1842 than zero.
1843
644459d0 18442006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
1845
1846 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
db375b8e 1847 * configure: Rebuilt.
644459d0 1848
093aec7c 18492006-11-01 Douglas Gregor <doug.gregor@gmail.com>
1850
1851 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
1852 for experimental C++0x mode.
1853 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
1854 adopted the preprocessor changes introduced in C99.
1855
54bb64fb 18562006-10-29 Joseph Myers <joseph@codesourcery.com>
1857
1858 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
1859 depending on --enable-targets=all.
1860 * configure: Regenerate.
1861
46139d3f 18622006-10-12 Jakub Jelinek <jakub@redhat.com>
1863
1864 PR preprocessor/28709
1865 * macro.c (paste_tokens): Do error reporting here, use BUF with the
1866 spelled LHS token as opposed to spelling it again.
1867 (paste_all_tokens): Don't report errors here, just break on failure.
1868
51f93521 18692006-10-10 Brooks Moses <bmoses@stanford.edu>
1870
1871 * Makefile.in: Added empty "pdf" target.
1872
32bca58b 18732006-09-22 Geoffrey Keating <geoffk@apple.com>
1874
1875 * configure.ac: Make need_64_bit_hwint case for x86-darwin
1876 match exactly the glob in gcc/config.gcc.
1877 * configure: Regenerate.
1878
0b67f687 18792006-09-13 Joseph S. Myers <joseph@codesourcery.com>
1880
1881 PR c/28768
1882 PR preprocessor/14634
1883 * lex.c (lex_string): Pedwarn for unterminated literals.
1884
3ebc7dec 18852006-09-08 Eric Christopher <echristo@apple.com>
1886
1887 * configure.ac: Add 64-bit HWI support for i?86-darwin.
1888
e58c07f7 18892006-08-14 Steve Ellcey <sje@cup.hp.com>
1890
1891 PR c++/28288
1892 PR c++/14556
1893 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
1894 (CPP_LAST_EQ): Change.
1895 (CPP_LAST_PUNCTUATOR): Change.
1896 * expr.c (cpp_operator): Remove MIN and MAX.
1897 (reduce): Remove CPP_MIN and CPP_MAX.
1898 (num_binary_op): Ditto.
1899 * lex.c (_cpp_lex_direct): Ditto.
1900 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
1901
add258d7 19022006-06-09 Jakub Jelinek <jakub@redhat.com>
1903
1904 PR preprocessor/27746
1905 * directives.c (do_pragma): Handle pragma with valid namespace
1906 and invalid name coming from macro expansion.
1907 * directives.c (destringize_and_run): Initialize next field in
1908 context.
1909
1910 PR c/27747
1911 PR c++/27748
1912 * directives.c (destringize_and_run): Set NO_EXPAND on the
1913 tokens.
1914
1915 * macro.c (_cpp_backup_tokens): Fix comment typo.
1916
49688a56 19172006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
1918
1919 * Makefile.in (CATALOGS): Add po/ prefix.
1920 * configure: Regenerated.
1921
8f597c12 19222006-05-23 Carlos O'Donell <carlos@codesourcery.com>
1923
1924 * Makefile.in: Add install-html target. Add install-html to .PHONY
1925
cca5dddc 19262006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
1927
1928 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
1929 * files.c (_cpp_get_file_stat): New function.
1930 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
1931 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
1932 * internal.h (_cpp_get_file_stat): Prototype.
1933 (struct cpp_buffer): Add timestamp.
1934
31614f7c 19352006-01-23 Jakub Jelinek <jakub@redhat.com>
1936
1937 PR preprocessor/25717
1938 * init.c (cpp_init_builtins): If __STDC__ will not change value
1939 between system headers and other sources, define it as a normal
1940 macro rather than a builtin.
1941 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
1942 cpp_in_system_header condition.
1943
19442006-01-05 Paolo Bonzini <bonzini@gnu.org>
3c77e017 1945
1946 * Makefile.in: Use -MMD instead of -MD.
1947
b75b98aa 19482006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
1949 Richard Henderson <rth@redhat.com>
1950
1951 Merge from gomp branch:
1952 * directives.c (struct pragma_entry): Add is_deferred. Add ident
1953 entry to value union.
1954 (end_directive): Don't eat the line if in_deferred_pragma.
1955 (run_directive): Remove pragma hacks.
1956 (insert_pragma_entry): Remove.
1957 (new_pragma_entry): New.
1958 (register_pragma_1): Split out of register_pragma. Only handle
1959 the lookup tree and return the new entry.
1960 (cpp_register_pragma): Fill in the pragma entry here.
1961 (cpp_register_deferred_pragma): New.
1962 (register_pragma_internal): New.
1963 (_cpp_init_internal_pragmas): Use register_pragma_internal.
1964 (do_pragma): Allow pragma expansion after namespace. For deferred
1965 pragmas, don't slurp the line into a string.
1966 (destringize_and_run): Save tokens for deferred pragmas.
1967 (cpp_handle_deferred_pragma): Remove.
1968 * macro.c (builtin_macro): Remove pragma token hack.
1969 (_cpp_push_token_context): Rename from push_token_context and export.
1970 * internal.h (struct lexer_state): Add pragma_allow_expansion.
1971 (_cpp_push_token_context): Declare.
1972 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
1973 a token. Update the line number correctly if so.
1974 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
1975 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
1976 * include/cpplib.h (PRAGMA_EOL): New.
1977 (CPP_TOKEN_FLD_PRAGMA): New.
1978 (struct cpp_token): Add val.pragma.
1979 (struct cpp_options): Remove defer_pragmas.
1980 (cpp_handle_deferred_pragma): Remove.
1981 (cpp_register_deferred_pragma): Declare.
1982
986ca356 19832006-01-01 Jakub Jelinek <jakub@redhat.com>
1984
1985 PR c++/25294
1986 * directives.c (do_pragma): If pragma line ends with multi-line
1987 block comment, end the saved deferred pragma string before that
1988 comment. Handle embedded '\0' chars on the pragma line.
1989
8dba02f7 19902005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
1991
1992 PR c++/23333
1993 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
1994
6db045b0 19952005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
1996 Ben Elliston <bje@au.ibm.com>
1997
1998 * include/cpplib.h (CPP_N_DFLOAT): New.
1999 * expr.c (interpret_float_suffix): Identify df, dd, and dl
2000 suffixes as decimal floating point constants.
2001 (cpp_classify_number): Disallow hexadecimal DFP constants.
2002
9a7c76f9 20032005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
b75b98aa 2004 Ian Lance Taylor <ian@airs.com>
9a7c76f9 2005
2006 * include/cpplib.h (struct cpp_callbacks): Annotate error with
2007 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
2008
0c5e3a3d 20092005-11-09 Per Bothner <per@bothner.com>
2010 Uros Bizjak <uros@kss-loka.si>
3ebc7dec 2011
0c5e3a3d 2012 PR c/24101
2013 * init.c (read_original_filename): Temporarily set
2014 state.in_directive before calling _cpp_lex_direct for
2015 CPP_HASH tokens.
2016
3c2359db 20172005-11-03 James E Wilson <wilson@specifix.com>
2018
2019 PR preprocessor/24202
2020 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
2021
d65b3a40 20222005-11-04 Joseph S. Myers <joseph@codesourcery.com>
2023
2024 * include/cpplib.h (struct cpp_callbacks): Make error take
2025 va_list* parameter.
2026 * errors.c (cpp_error): Update call to callback.
2027
cc9012f7 20282005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
2029
2030 PR preprocessor/22042
2031 * macro.c (_cpp_builtin_macro_text): Lower the needed max
2032 buffer size.
2033 (cpp_quote_string): Don't octalify non printable
2034 charactors.
2035
eb0d20b7 20362005-11-03 Joseph S. Myers <joseph@codesourcery.com>
2037
2038 PR c++/17964
2039 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
2040 (struct cpp_callbacks): Add error.
2041 * errors.c (cpp_error): If client_diagnostic, use error callback.
2042 * charset.c (convert_escape): Don't use %03o in diagnostic.
2043
de4aacc0 20442005-10-21 James E Wilson <wilson@specifix.com>
04c0bfd0 2045
2046 PR preprocessor/15220
2047 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
2048 callers. Pass to open_file_failed.
2049 (open_file_failed): New parameter angle_brackets. Fix all callers.
2050 Use in print_dep assignment.
2051 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
2052 * internal.h (_cpp_find_file): Add new parm to declaration.
3ebc7dec 2053
6783d878 20542005-10-08 Kazu Hirata <kazu@codesourcery.com>
2055
2056 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
2057 * configure: Regenerate.
2058
f789fe3e 20592005-10-04 Ian Lance Taylor <ian@airs.com>
2060
2061 PR preprocessor/13726
2062 * directives.c (check_eol_return_comments): New static function.
2063 (parse_include): Add buf parameter. Change all callers.
2064 (do_include_common): If not discard comments, turn on
2065 save_comments. Pass collected comments to include callback.
2066 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
2067 include callback: cpp_token list.
2068
865c4e44 20692005-09-20 Joseph S. Myers <joseph@codesourcery.com>
2070
2071 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
2072 * init.c (struct lang_flags, lang_defaults): Add
2073 extended_identifiers.
2074 (cpp_set_lang): Use it.
2075 * lex.c (forms_identifier_p): Check extended_identifiers.
2076
56845aa6 20772005-08-30 Jakub Jelinek <jakub@redhat.com>
2078
2079 PR preprocessor/20348
2080 PR preprocessor/20356
2081 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
2082 2004-06-05 changes.
2083
72ee8ff9 20842005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2085
2086 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
2087 -Wmissing-format-attribute.
2088
2089 * configure: Regenerate.
2090
2656917a 20912005-06-29 Kelley Cook <kcook@gcc.gnu.org>
2092
2093 * all files: Update FSF address in copyright headers.
2094 * makeucnid.c (write_copyright): Update outputted FSF address.
2095
cbaa9876 20962005-06-13 Zack Weinberg <zack@codesourcery.com>
2097
2098 * configure.ac: Invoke ZW_CREATE_DEPDIR and
2099 ZW_PROG_COMPILER_DEPENDENCIES.
2100 * aclocal.m4, configure: Regenerate.
2101 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
2102 New variables.
2103 (distclean): Clean up $(DEPDIR) and its contents.
2104 (.c.o): Use $(COMPILE).
2105 Include $(DEPDIR)/*.Po for most object->header dependencies.
2106
720aca92 21072005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2108
2109 * configure.ac: Check declarations for asprintf and vasprintf.
2110 * config.in: Regenerate.
2111 * configure: Likewise.
2112
2113 * charset.c (conversion_loop): Use XRESIZEVEC.
2114 (convert_no_conversion): Likewise.
2115 (convert_using_iconv): Likewise.
2116 (init_iconv_desc): Cast return value of alloca.
2117 (cpp_host_to_exec_charset): Use XNEWVEC.
2118 (emit_numeric_escape): Use XRESIZEVEC.
2119 (cpp_interpret_string): Use XNEWVEC.
2120 (cpp_interpret_string): Use XRESIZEVEC.
2121 (_cpp_interpret_identifier): Cast return value of alloca.
2122 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
2123 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
2124 (parse_include): Use XNEWVEC.
2125 (insert_pragma_entry): Rename local variable "new" to
cbaa9876 2126 "new_entry".
720aca92 2127 (save_registered_pragmas): Cast return value of xmemdup.
2128 (destringize_and_run): Same for alloca.
2129 (parse_assertion): Likewise.
2130 (do_assert): Cast allocated storage to proper type.
2131 (cpp_define): Likewise.
2132 (_cpp_define_builtin): Likewise.
2133 (cpp_undef): Likewise.
2134 (handle_assertion): Likewise.
2135 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
2136 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
2137 (CPP_UMINUS): Likewise.
2138 (struct cpp_operator): Rename from struct operator.
2139 (_cpp_expand_op_stack): Use XRESIZEVEC.
2140 * files.c (pch_open_file): Use XNEWVEC.
2141 (pch_open_file): Use XRESIZEVEC.
2142 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
2143 (dir_name_of_file): Use XNEWVEC.
2144 (make_cpp_file): Use XCNEW.
2145 (make_cpp_dir): Likewise.
2146 (allocate_file_hash_entries): USE XNEWVEC.
2147 (cpp_included): Cast return value of htab_find_with_hash.
2148 (append_file_to_dir): Use XNEWVEC.
2149 (read_filename_string): Likewise. Use XRESIZEVEC too.
2150 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
2151 (remap_filename): Use XNEWVEC.
2152 (struct pchf_entry): Move definition out of struct pchf_data.
2153 (_cpp_save_file_entries): Use XCNEWVAR.
2154 (_cpp_read_file_entries): Use XNEWVAR.
2155 * identifiers.c (alloc_node): Use XOBNEW.
2156 * init.c (cpp_create_reader): Use XCNEW.
2157 (cpp_init_builtins): Cast of b->value to enum builtin_type.
2158 (read_original_directory): Cast return value of alloca.
2159 * lex.c (add_line_note): Use XRESIZEVEC.
2160 (warn_about_normalization): Use XNEWVEC.
2161 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
2162 (new_buff): Use XNEWVEC.
2163 * line-map.c (linemap_add): Use XRESIZEVEC.
2164 * macro.c (builtin_macro): Cast return value of alloca.
2165 (paste_tokens): Likewise.
2166 (expand_arg): Use XNEWVEC and XRESIZEVEC.
2167 (_cpp_save_parameter): Use XRESIZEVEC.
2168 (create_iso_definition): Cast allocated storage to proper type.
2169 (_cpp_create_definition): Likewise.
2170 (cpp_macro_definition): Use XRESIZEVEC.
2171 * makedepend.c (add_clm): Use XNEW.
2172 (add_dir): Likewise.
2173 * mkdeps.c (munge): Use XNEWVEC.
2174 (deps_init): Use XCNEW.
2175 (deps_add_target): Use XRESIZEVEC.
2176 (deps_add_default_target): Cast return value of alloca.
2177 (deps_add_dep): Use XRESIZEVEC.
2178 (deps_add_vpath): Likewise. Use XNEWVEC too.
2179 (deps_restore): Likewise.
2180 * pch.c (save_idents): Use XNEW and XNEWVEC.
2181 (cpp_save_state): Use XNEW.
2182 (count_defs): Cast return value of htab_find.
2183 (write_defs): Likewise.
2184 (cpp_write_pch_deps): Use XNEWVEC.
2185 (collect_ht_nodes): Use XRESIZEVEC.
2186 (cpp_valid_state): Use XNEWVEC.
2187 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
2188 * symtab.c (ht_create): Use XCNEW.
2189 (ht_lookup_with_hash): Cast return value of obstack_copy0.
2190 (ht_expand): Use XCNEWVEC.
2191 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
2192 (bool): Do not define if __cplusplus.
2193
81e19b31 21942005-05-12 Zack Weinberg <zack@codesourcery.com>
2195
2196 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
2197 (do_sccs): Delete function definition, #define to do_ident.
2198 (do_ident): Don't hardwire directive name.
2199
18f11b84 22002005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
2201
2202 PR bootstrap/21230
2203 * configure: Regenerate.
2204
2dc04f36 22052005-04-27 Andris Pavenis <pavenis@latnet.lv>
2206
2207 * files.c: Include io.h for DJGPP to get prototype of setmode.
2208
0b7f838f 22092005-04-19 Per Bothner <per@bothner.com>
2210
2211 PR preprocessor/20907
2212 * line-map.c (linemap_line_start): Fix bug when we need to increse
2213 column_bits but can re-use the current line_map.
2214
2224c90b 22152005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2216
2217 * system.h (fopen, fdopen, freopen): Define these to the unlocked
2218 libiberty functions.
2219
077a3c99 22202005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2221
2222 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
2223 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
2224 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
2225 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
2226 _unlocked function.
2227 (fwrite_unlocked): Fix prototype.
81e19b31 2228
077a3c99 2229 * configure, config.in: Regenerate.
2230
99617355 22312005-04-05 Jakub Jelinek <jakub@redhat.com>
2232
2233 PR preprocessor/19475
2234 * macro.c (create_iso_definition): For < ISO C99, don't
2235 pedwarn if there is no whitespace between macro name and its
2236 replacement, but the replacement starts with a basic character
2237 set character.
2238
3827dee5 22392005-03-28 Andreas Jaeger <aj@suse.de>
2240
2241 * lex.c (warn_about_normalization): Cast field width to int to
2242 avoid warning.
2243
b8273627 22442005-03-19 Joseph S. Myers <joseph@codesourcery.com>
2245
2246 * configure.ac: Consistently use solaris2.1[0-9]* instead of
2247 solaris2.1[0-9].
2248 * configure: Regenerate.
2249
bc65f24f 22502005-03-15 Geoffrey Keating <geoffk@apple.com>
2251
2252 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
2253 UCN rather than printing an error.
2254
bce47149 22552005-03-14 Geoffrey Keating <geoffk@apple.com>
2256
4e9d1e6d 2257 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
2258
22592005-03-14 Geoffrey Keating <geoffk@apple.com>
81e19b31 2260
bce47149 2261 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
2262 * charset.c: Update for new format of ucnid.h.
2263 (ucn_valid_in_identifier): Update for new format of ucnid.h.
2264 Add NST parameter, and update it; update callers.
2265 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
2266 with cpp_error.
2267 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
2268 * internal.h (struct normalize_state): New.
2269 (INITIAL_NORMALIZE_STATE): New.
2270 (NORMALIZE_STATE_RESULT): New.
2271 (NORMALIZE_STATE_UPDATE_IDNUM): New.
2272 (_cpp_valid_ucn): New.
2273 * lex.c (warn_about_normalization): New.
2274 (forms_identifier_p): Add normalize_state parameter, update callers.
2275 (lex_identifier): Add normalize_state parameter, update callers. Keep
2276 the state current.
2277 (lex_number): Likewise.
2278 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
2279 it with warn_about_normalization.
2280 * makeucnid.c: New.
2281 * ucnid.h: Replace.
2282 * ucnid.pl: Remove.
2283 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
2284 comments about obsolete version of C++.
2285 * include/cpplib.h (enum cpp_normalize_level): New.
2286 (struct cpp_options): Add warn_normalize field.
2287
bb1fa6bb 22882005-03-11 Geoffrey Keating <geoffk@apple.com>
2289
2290 * directives.c (glue_header_name): Update call to cpp_spell_token.
2291 * internal.h (_cpp_interpret_identifier): New.
2292 * charset.c (_cpp_interpret_identifier): New.
2293 (_cpp_valid_ucn): Allow UCN version of '$'.
2294 * lex.c (lex_identifier): Add extra parameter to indicate if initial
2295 character was '$' or '\'. Support identifiers with UCNs.
2296 (forms_identifier_p): Allow UCNs.
2297 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
2298 (utf8_to_ucn): New.
2299 (cpp_spell_token): Add FORSTRING parameter. Use it.
2300 (cpp_token_as_text): Update call to cpp_spell_token.
2301 (cpp_output_token): Write UCNs back out.
2302 (stringify_arg): Update call to cpp_spell_token.
2303 (paste_tokens): Likewise.
2304 (cpp_macro_definition): Likewise.
2305 * macro.c (stringify_arg): Likewise.
2306 (paste_tokens): Likewise.
2307 (cpp_macro_definition): Likewise.
2308 * include/cpplib.h: Add parameter to cpp_spell_token.
2309
960391da 23102005-03-04 Jakub Jelinek <jakub@redhat.com>
2311
2312 PR bootstrap/20282
2313 PR bootstrap/20305
2314 * macro.c (replace_args, cpp_get_token): Copy whole
2315 cpp_token_u instead of just cpp_string field from it.
2316
b0d0794d 23172005-02-28 Devang Patel <dpatel@apple.com>
2318
2319 * directives.c (do_line): Save sysp early before line table is
2320 realloc'ed.
81e19b31 2321
624d37a6 23222005-02-20 Zack Weinberg <zack@codesourcery.com>
2323
2324 PR 18785
2325 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
2326 (cpp_host_to_exec_charset): New function.
2327 * include/cpplib.h: Declare cpp_host_to_exec_charset.
2328
f86986bc 23292005-02-19 Devang Patel <dpatel@apple.com>
2330
2331 * charset.c (_cpp_convert_input): Check '\r' before inserting
2332 '\n' at the end.
624d37a6 2333
9936e07d 23342005-02-15 Eric Christopher <echristo@redhat.com>
2335
2336 PR preprocessor/19077
2337 * macro.c (cpp_macro_definition): Move handling of whitespace
2338 to PREV_WHITE conditional. Remove overloading of len
2339 variable.
2340
129a1540 23412005-02-14 Kazu Hirata <kazu@cs.umass.edu>
2342
2343 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
2344 traditional.c: Update copyright.
2345
bb30d1f4 23462005-02-14 Paolo Bonzini <bonzini@gnu.org>
2347
2348 PR bootstrap/19818
2349 * configure.ac: Check for declaration of basename and getopt.
2350 * config.in: Regenerate.
2351 * configure: Regenerate.
2352 * internal.h (ustrcspn): New.
2353 * macro.c (create_iso_definition): Fix allocation of memory.
2354 (padding_token): Add cast to remove const-ness.
2355 * pch.c (cpp_read_state): Use ustrcspn.
2356
26ec4f15 23572005-02-08 Mike Stump <mrs@apple.com>
2358
2359 * files.c (pchf_adder): Remove.
2360 (struct pchf_adder_info): Likewise.
2361 (_cpp_save_file_entries): Write out all files so that #import works.
2362
0cb78cbd 23632005-01-23 Joseph S. Myers <joseph@codesourcery.com>
2364
2365 * configure: Regenerate.
2366
d862067c 23672005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
2368
2369 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
2370
457e71e4 2371 * include/cpplib.h: Also update copyright years.
624d37a6 2372
ba841ef8 23732005-01-03 Geoffrey Keating <geoffk@apple.com>
2374
2375 * files.c (_cpp_find_file): Add files found by search_path_exhausted
2376 to the list of all files.
2377
f03668bd 23782005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
2379
2380 * internal.h: Update references to Cpp lib filenames.
2381 * directives.c: Likewise.
2382 * init.c: Likewise.
2383 * macro.c: Likewise.
2384 * traditional.c: Likewise.
2385
461ea98d 23862004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
2387
2388 PR preprocessor/15167
2389 * files.c (destroy_cpp_file): New function.
2390 (should_stack_file): Make a new file if the
2391 compared file is still stacked.
2392
bd9e37a6 23932004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
2394
624d37a6 2395 PR preprocessor/17610
bd9e37a6 2396 * directives.c (do_include_common): Error out if an empty filename
2397 is given for #include (or #include_next or #import).
2398
fe4dcd90 23992004-11-27 Roger Sayle <roger@eyesopen.com>
2400 Zack Weinberg <zack@codesourcery.com>
2401
2402 * internal.h: Replace all uses of uchar with unsigned char.
2403 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
2404 with !IN_GCC, so uchar is only defined whilst building libcpp.
2405
ac7cc2f4 24062004-11-24 Kelley Cook <kcook@gcc.gnu.org>
2407
2408 * aclocal.m4: Regenerate.
2409
6e11b263 24102004-11-24 Roger Sayle <roger@eyesopen.com>
2411
2412 PR preprocessor/15824
2413 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
2414 directly, instead of the non-existant "system.h" and "ansidecl.h".
2415 * configure: Regenerate.
2416
68bf2ad9 24172004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 2418 Joseph Myers <joseph@codesourcery.com>
68bf2ad9 2419
2420 * internal.h (struct lexer_state): Add in_deferred_pragma.
2421 * directives.c (struct pragma_entry): Add allow_expansion.
2422 (insert_pragma_entry): Take allow_expansion flag.
2423 (register_pragma): Likewise.
2424 (cpp_register_pragma): Likewise.
2425 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
2426 (do_pragma): Honor allow_expansion.
2427 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
2428 * include/cpplib.h (cpp_register_pragma): Update prototype.
2429
27559c4e 24302004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
624d37a6 2431 Mark Mitchell <mark@codesourcery.com>
27559c4e 2432
2433 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
2434 need_64bit_hwint=yes.
2435 * configure: Regenerate.
2436
34ae664d 24372004-11-09 Joseph S. Myers <joseph@codesourcery.com>
2438
2439 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
2440 po/$(PACKAGE).pot.
2441 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
2442 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
2443 Remove local srcdir path from generated file.
2444
39b83bdb 24452004-11-04 Zack Weinberg <zack@codesourcery.com>
624d37a6 2446 Gerald Pfeifer <gerald@pfeifer.com>
39b83bdb 2447
2448 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
2449 as well.
2450
a095c1b5 24512004-10-27 Zack Weinberg <zack@codesourcery.com>
2452
2453 PR 18075
2454 * directives.c (do_pragma): Do not defer pragmas which are unknown.
2455 (cpp_handle_deferred_pragma): Add cast to silence warning.
2456
700b0d81 24572004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
2458
2459 * errors.c (_cpp_begin_message): Print "error: " for errors.
2460
fbe83ac1 24612004-10-10 Andreas Jaeger <aj@suse.de>
2462
2463 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
2464 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
2465
09f10c94 24662004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
2467
2468 * pch.c (cpp_write_pch_state): Remove variable z as it is not
2469 used.
2470 (cpp_read_state): Remove unused variables, m, d and mac_count.
2471
a8b2a8d5 24722004-09-29 Per Bothner <per@bothner.com>
2473
2474 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
2475 cb.line_change. Otherwise do_pragma will call the line_change
2476 call-back with a meaningless line number.
2477
21164c01 24782004-09-24 Zack Weinberg <zack@codesourcery.com>
2479
2480 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
2481 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
2482 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
2483 * aclocal.m4, configure: Regenerate.
2484 * init.c: Include localedir.h.
2485 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
2486 (DEFS): Delete.
2487 (.c.o): Use $(ALL_CFLAGS).
2488 (localedir.h, localedir.hs): New rules.
2489 (clean): Use rm -rf to remove directories.
2490 (distclean): Also delete localedir.h and localedir.hs.
2491 (init.o): Update dependencies.
2492
986086aa 24932004-09-22 Kelley Cook <kcook@gcc.gnu.org>
2494
2495 * Makefile.in (aclocal.m4): Update dependencies.
2496 * configure.ac (AC_CONFIG_MACRO_DIR): New.
2497 * aclocal.m4, configure: Regenerate.
2498
e9cc3617 24992004-09-17 Zack Weinberg <zack@codesourcery.com>
2500
0097f6a2 2501 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
2502 (_cpp_convert_input, _cpp_default_encoding): Add comments.
2503 Some other comments in this file also tweaked.
2504
e9cc3617 2505 * directives.c (do_pragma): Save current buffer position
2506 before lexing the pragma keywords; don't call
2507 _cpp_backup_tokens in the defer_pragmas case.
2508
9832c977 25092004-09-15 Per Bothner <per@bothner.com>
2510
2511 * include/line-map.h (line_map_start): Add parameter names so
2512 preceding comment makes sense.
2513 (linemap_add): Remove from comment mention of non-existing parameter.
2514
d6d3c909 25152004-09-09 Matt Austern <austern@apple.com>
2516 Zack Weinberg <zack@codesourcery.com>
2517
2518 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
2519 prefixes throughout. Add entry for PRAGMA. Remove
2520 unnecessary "= 0" from EQ.
2521 (enum cpp_ttype): Adjust OP and TK definitions to restore
2522 prefixes, via token-paste.
2523 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
2524 Change from #defines to additional cpp_ttype enumerators.
2525 (struct cpp_options): Add defer_pragmas.
2526 (cpp_handle_deferred_pragma): Prototype new interface.
2527
2528 * internal.h (struct cpp_reader): Add directive_result.
2529 * directives.c (struct pragma_entry): Add is_internal field;
2530 give boolean fields type bool.
2531 (start_directive): Initialize pfile->directive_result.type.
2532 (_cpp_do__Pragma): Likewise.
2533 (run_directive): Do not crash if pfile->buffer->prev is NULL.
2534 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
2535 from it.
2536 (register_pragma): New static function, bulk of former
2537 cpp_register_pragma here; add 'internal' argument, pass along
2538 to insert_pragma_entry.
2539 (cpp_register_pragma): Now a wrapper around register_pragma which
2540 always passes false for 'internal' argument.
2541 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
2542 true for 'internal'.
2543 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
2544 an internal pragma, save text till the end of the line as a CPP_PRAGMA
2545 token instead of executing the pragma.
2546 (cpp_handle_deferred_pragma): New interface.
2547 * lex.c (token_spellings): Adjust OP and TK definitions to
2548 match changes to cpplib.h.
2549 (_cpp_lex_token): Check for a directive-result token and
2550 return it if present.
2551 (cpp_token_val_index): Handle CPP_PRAGMA.
2552 * macro.c (cpp_builtin_macro_text): Correct comment.
2553 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
2554
735a9bc4 25552004-09-06 Serge Belyshev <belyshev@lubercy.com>
2556
2557 PR preprocessor/14699
2558 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
2559 from size_t to double.
2560
25696d3f 25612004-08-28 Andreas Schwab <schwab@suse.de>
2562 Andreas Jaeger <aj@suse.de>
2563
2564 * configure.ac: Set PACKAGE correctly.
2565 * configure: Regenerated.
2566
99439f5b 25672004-08-25 Paolo Bonzini <bonzini@gnu.org>
2568
2569 * Makefile.in: Add back top_builddir.
2570
a668be26 25712004-08-25 Paolo Bonzini <bonzini@gnu.org>
2572
2573 * configure.ac: Replace Automake macro invocations
2574 with manual Autoconf checks and substitutions.
2575 * configure: Regenerate.
2576 * aclocal.m4: Regenerate.
2577 * config.in: Regenerate.
2578 * Makefile.am: Removed.
2579 * Makefile.in: Heavy simplification and reorganization.
2580
30e9913f 25812004-08-09 Mark Mitchell <mark@codesourcery.com>
2582
2583 * configure.ac (arm*-*-eabi*): New target.
2584 (arm*-*-symbianelf*): Likewise.
2585 * configure: Regenerated.
2586
3b298764 25872004-07-24 Bernardo Innocenti <bernie@develer.com>
2588
2589 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
2590 * directives.c: Use XNEW-family macros from libiberty.
2591 * lex.c: Likewise.
2592 * macro.c: Likewise.
2593 * cpplib.h (cpp_deps_style): Export enum with name.
2594
d6d3c909 25952004-07-23 Matthias Klose <doko@debian.org>
3b298764 2596
d6d3c909 2597 * init.c (init_library): Use PACKAGE for the text domain.
1ed7d058 2598
821fa045 25992004-07-16 Andris Pavenis <pavenis@latnet.lv>
2600
2601 PR preprocessor/16366
2602 * internal.h (struct cpp_reader): New field dir_hash.
2603 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
2604 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
2605
d80efa72 26062004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
2607
2608 PR preprocessor/16192
2609 PR preprocessor/15913
2610 PR preprocessor/15572
2611 * expr.c (_cpp_parse_expr): Handle remaining cases where an
2612 expression is missing.
2613 * init.c (post_options): Traditional cpp doesn't do // comments.
2614
ed000086 26152004-06-30 Per Bothner <per@bothner.com>
2616
2617 * include/line-map.h (fileline): Remove old typedef.
2618 * internal.h (struct cpp_reader): Use source_location typedef instead.
2619
dcb9d064 26202004-06-26 Zack Weinberg <zack@codesourcery.com>
2621
2622 Partially revert patch of 2004-06-05.
2623 * files.c (search_cache): Remove pfile argument. Don't check
2624 for file that would be found by "" or <> search here...
2625 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
2626 Do not apply directory-of-current-file correction to files
2627 found by this check. Rearrange code slightly.
2628
d718b525 26292004-06-21 Geoffrey Keating <geoffk@apple.com>
2630
2631 * files.c (should_stack_file): Correct swapped parameters to call
2632 to cb.read_pch.
2633 * pch.c (cpp_valid_state): Handle -fpreprocessed.
2634
79b68529 26352004-06-15 Paolo Bonzini <bonzini@gnu.org>
2636
2637 * Makefile.in: Regenerate with automake 1.8.5.
2638 * aclocal.m4: Likewise.
2639 * configure: Regenerate.
2640
151899c5 26412004-06-11 Zack Weinberg <zack@codesourcery.com>
2642
2643 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
2644 * configure, config.in: Regenerate.
2645 * system.h: Unconditionally define bool as unsigned char,
2646 BOOL_BITFIELD as unsigned int.
2647 * .cvsignore: New file.
2648
c39ed964 26492004-06-09 Geoffrey Keating <geoffk@apple.com>
2650
2651 * traditional.c (push_replacement_text): Set macro->traditional.
2652 (save_replacement_text): Likewise.
2653 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
2654 (struct save_macro_item): Delete.
2655 (struct save_macro_data): Use a character array not the previous
2656 structured format.
2657 (save_macros): Save macro as text not as internal structures.
2658 (cpp_prepare_state): Update for changes to save_macro_data.
2659 (cpp_read_state): Don't read macros defined in PCH. Restore
c84ca916 2660 -D macros as text.
c39ed964 2661 * macro.c (create_iso_definition): Honour alloc_subobject.
2662 Clear traditional flag.
2663 (_cpp_create_definition): Honour alloc_subobject.
2664 * lex.c (cpp_token_val_index): New.
2665 * internal.h: Include cpp-id-data.h.
2666 (uchar): Move definition to cpp-id-data.h.
2667 (U): Likewise.
2668 (cpp_macro): Likewise.
2669 * directives.c (struct answer): Move to cpp-id-data.h.
2670 (do_assert): Honour alloc_subobject.
c84ca916 2671
2672 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
2673 * include/cpplib.h (struct cpp_string): Add GTY marker.
2674 (enum cpp_token_fld_kind): New.
2675 (struct cpp_token): Add GTY markers.
2676 (cpp_token_val_index): Prototype.
2677 (CPP_HASHNODE_VALUE_IDX): New.
2678 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
2679 * include/cpp-id-data.h: New file.
c39ed964 2680
dd6e5561 26812004-06-09 Paolo Bonzini <bonzini@gnu.org>
2682
2683 * Makefile.am (all-local): New.
2684 * Makefile.in: Regenerate.
2685
8af0c78d 26862004-06-06 Roger Sayle <roger@eyesopen.com>
2687
2688 * Makefile.am (LIBICONV): Declare.
2689 (makedepend_LDADD): Use LIBICONV.
2690 * Makefile.in: Regenerate.
2691
30302733 26922004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
2693
2694 * Makefile.am (LIBINTL): Declare
2695 (makedepend_LDADD): Use LIBINTL.
2696 * Makefile.in: Regenerate.
2697
3eb3f293 26982004-06-05 Zack Weinberg <zack@codesourcery.com>
2699
2700 * Makefile.am: Add makedepend.
2701 * Makefile.in, aclocal.m4: Regenerate.
2702 * charset.c: Insert a space to avoid a warning.
2703 * directives.c: Include mkdeps.h.
2704 (_cpp_handle_directive): Reenable macro expander if appropriate.
2705 (undefine_macros): Inline body of _cpp_free_definition for speed.
2706 Do not call undef callback or _cpp_warn_if_unused_macro.
2707 (cpp_get_deps): New interface.
2708 * files.c (search_cache): Add pfile argument. Check for file
2709 that would be found by "" or <> search here...
2710 (_cpp_find_file): ...not here. Correct recorded start_dir of
2711 files found by directory-of-current-file search that would be
2712 found by "" or <> search.
2713 * init.c (cpp_add_dependency_target): Delete.
2714 * internal.h (struct lexer_state): Add discarding_output flag.
2715 * lex.c (lex_identifier): Compute hash function while scanning.
2716 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
2717 directives.
2718 * makedepend.c: New file.
2719 * mkdeps.c (struct deps): Add vpath vector.
2720 (apply_vpath, deps_add_vpath): New function.
2721 (deps_free): Free vpath vector.
2722 (deps_add_dep, deps_add_target): Use apply_vpath.
2723 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
2724 (ht_lookup_with_hash): New function.
2725 * cpplib.h, mkdeps.h: Update prototypes.
2726 * symtab.h: Update prototypes.
2727 (HT_HASHSTEP, HT_FINISH): New macros.
2728
8ed01400 27292004-05-29 Geoffrey Keating <geoffk@apple.com>
2730
2731 * symtab.c (ht_create): Set entries_owned.
2732 (ht_destroy): Honour entries_owned.
2733 (ht_expand): Likewise.
2734 (ht_load): New.
c84ca916 2735 * include/symtab.h (struct ht): New field 'entries_owned'
2736 (ht_load): New prototype.
8ed01400 2737
347a3ab5 27382004-05-26 Paolo Bonzini <bonzini@gnu.org>
2739
2740 PR bootstrap/15651
2741 * configure.ac: Fix m4 quoting when picking
2742 the size of HOST_WIDE_INT.
2743 * configure: Regenerate.
2744
fc231f28 27452004-05-25 Paolo Bonzini <bonzini@gnu.org>
2746
2747 * Makefile.am: the correct directory for
2748 gettext include files is given by @INCINTL@.
2749 * Makefile.in: Regenerate.
2750
babfbd63 27512004-05-24 Paolo Bonzini <bonzini@gnu.org>
2752
2753 * system.h [!ENABLE_NLS]: dgettext takes two
2754 parameters.
2755
d856c8a6 27562004-05-23 Paolo Bonzini <bonzini@gnu.org>
2757
2758 Moved libcpp from the gcc subdirectory to the toplevel.
2759 * Makefile.am: New file.
2760 * Makefile.in: Regenerate.
2761 * configure.ac: New file.
2762 * configure: Regenerate.
2763 * config.in: Regenerate.
2764 * charset.c: Moved from gcc/cppcharset.c. Add note about
2765 brokenness of input charset detection. Adjust for change
2766 in name of cppucnid.h.
2767 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
2768 * expr.c: Moved from gcc/cppexp.c.
2769 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
2770 Remove #define of O_BINARY, it is in system.h.
2771 * identifiers.c: Moved from gcc/cpphash.c.
2772 * internal.h: Moved from gcc/cpphash.h. Change header
2773 guard name. All other files adjusted to match name change.
2774 * init.c: Moved from gcc/cppinit.c.
2775 (init_library) [ENABLE_NLS]: Call bindtextdomain.
2776 * lex.c: Moved from gcc/cpplex.c.
2777 * directives.c: Moved from gcc/cpplib.c.
2778 * macro.c: Moved from gcc/cppmacro.c.
2779 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
2780 * traditional.c: Moved from gcc/cpptrad.c.
2781 * ucnid.h: Moved from gcc/cppucnid.h. Change header
2782 guard name.
2783 * ucnid.pl: Moved from gcc/cppucnid.pl.
2784 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
2785 guard name.
2786 * symtab.c: Moved from gcc/hashtable.c.
2787 * line-map.c: Moved from gcc. Do not include intl.h.
2788 * mkdeps.c: Moved from gcc.
2789 * system.h: New file.
c84ca916 2790 * include/cpplib.h: Moved from gcc. Change header guard name.
2791 * include/line-map.h: Moved from gcc. Change header guard name.
2792 * include/mkdeps.h: Moved from gcc. Change header guard name.
2793 * include/symtab.h: Moved from gcc/hashtable.h. Change header
2794 guard name.