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