]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/ChangeLog
Daily bump.
[thirdparty/gcc.git] / libcpp / ChangeLog
CommitLineData
54da09ee
RB
12014-05-20 Richard Biener <rguenther@suse.de>
2
3 * configure.ac: Copy gcc logic of detecting a 64bit type.
4 Remove HOST_WIDE_INT define.
5 * include/cpplib.h: typedef cpp_num_part to a 64bit type,
6 similar to how hwint.h does it.
7 * config.in: Regenerate.
8 * configure: Likewise.
9
eac3e079
JY
102014-05-09 Joey Ye <joey.ye@arm.com>
11
12 * files.c (find_file_in_dir): Always try to shorten for DOS
13 non-system headers.
14 * init.c (ENABLE_CANONICAL_SYSTEM_HEADERS): Default enabled for DOS.
15
f543058d
RB
162014-05-07 Richard Biener <rguenther@suse.de>
17
18 * configure.ac: Always set need_64bit_hwint to yes.
19 * configure: Regenerated.
20
d9f069ab
RO
212014-04-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
22
23 * lex.c: Remove Solaris 9 reference.
24
341c653c
WL
252014-02-24 Walter Lee <walt@tilera.com>
26
27 * configure.ac: Change "tilepro" triplet to "tilepro*".
28 * configure: Regenerate.
29
179652df
JJ
302014-02-19 Jakub Jelinek <jakub@redhat.com>
31
32 PR preprocessor/58844
33 * macro.c (enter_macro_context): Only push
34 macro_real_token_count (macro) tokens rather than
35 macro->count tokens, regardless of
36 CPP_OPTION (pfile, track-macro-expansion).
37
acf601ae
JJ
382014-02-07 Jakub Jelinek <jakub@redhat.com>
39
40 PR preprocessor/56824
41 * line-map.c (get_combined_adhoc_loc, linemap_get_expansion_line,
42 linemap_get_expansion_filename, linemap_location_in_system_header_p,
43 linemap_location_from_macro_expansion_p,
44 linemap_macro_loc_to_spelling_point, linemap_macro_loc_to_def_point,
45 linemap_macro_loc_to_exp_point, linemap_expand_location): Fix
46 formatting.
47 (linemap_compare_locations): Look through adhoc locations for both
48 l0 and l1.
49
7ecc3eb9
DS
502014-01-23 Dodji Seketeli <dodji@redhat.com>
51
52 PR PR preprocessor/58580
53 * include/line-map.h (linemap_get_file_highest_location): Declare
54 new function.
55 * line-map.c (linemap_get_file_highest_location): Define it.
56
35c3d610
RS
572014-01-02 Richard Sandiford <rdsandiford@googlemail.com>
58
59 Update copyright years
60
3a4efce7
JM
612013-12-09 Joseph Myers <joseph@codesourcery.com>
62
63 PR preprocessor/55715
64 * expr.c (num_binary_op): Implement subtraction directly rather
65 than with negation and falling through into addition case.
66
aadce585
BS
672013-11-18 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
68
69 * lex.c (search_line_fast): Correct for little endian.
70
d3f4ff8b
JM
712013-11-15 Joseph Myers <joseph@codesourcery.com>
72
73 * ucnid.tab: Add C11 and C11NOSTART data.
74 * makeucnid.c (digit): Rename enum value to N99.
75 (C11, N11, all_languages): New enum values.
76 (NUM_CODE_POINTS, MAX_CODE_POINT): New macros.
77 (flags, decomp, combining_value): Use NUM_CODE_POINTS as array
78 size.
79 (decomp): Use unsigned int as element type.
80 (all_decomp): New array.
81 (read_ucnid): Handle C11 and C11NOSTART. Use MAX_CODE_POINT.
82 (read_table): Use MAX_CODE_POINT. Store all decompositions in
83 all_decomp.
84 (read_derived): Use MAX_CODE_POINT.
85 (write_table): Use NUM_CODE_POINTS. Print N99, C11 and N11
86 flags. Print whole array variable declaration rather than just
87 array contents.
88 (char_id_valid, write_context_switch): New functions.
89 (main): Call write_context_switch.
90 * ucnid.h: Regenerate.
91 * include/cpplib.h (struct cpp_options): Add c11_identifiers.
92 * init.c (struct lang_flags): Add c11_identifiers.
93 (cpp_set_lang): Set c11_identifiers option from selected language.
94 * internal.h (struct normalize_state): Document "previous" as
95 previous starter character.
96 (NORMALIZE_STATE_UPDATE_IDNUM): Take character as argument.
97 * charset.c (DIG): Rename enum value to N99.
98 (C11, N11): New enum values.
99 (struct ucnrange): Give name to struct. Use short for flags and
100 unsigned int for end of range. Include ucnid.h for whole variable
101 declaration.
102 (ucn_valid_in_identifier): Allow for characters up to 0x10FFFF.
103 Allow for C11 in determining valid characters and valid start
104 characters. Use check_nfc for non-Hangul context-dependent
105 checks. Only store starter characters in nst->previous.
106 (_cpp_valid_ucn): Pass new argument to
107 NORMALIZE_STATE_UPDATE_IDNUM.
108 * lex.c (lex_identifier): Pass new argument to
109 NORMALIZE_STATE_UPDATE_IDNUM. Call NORMALIZE_STATE_UPDATE_IDNUM
110 after initial non-UCN part of identifier.
111 (lex_number): Pass new argument to NORMALIZE_STATE_UPDATE_IDNUM.
112
54848ff8
JM
1132013-11-15 Joseph Myers <joseph@codesourcery.com>
114
115 * ucnid.tab: Mark C99 digits as [C99DIG].
116 * makeucnid.c (read_ucnid): Handle [C99DIG].
117 (read_table): Don't check for digit characters.
118 * ucnid.h: Regenerate.
119
5157b91e
TB
1202013-11-06 Tobias Burnus <burnus@net-b.de>
121
122 * macro.c (_cpp_builtin_macro_text): Correct
123 wording of two warnings.
124
e8ff5196
TB
1252013-11-05 Tobias Burnus <burnus@net-b.de>
126
127 * include/cpplib.h (CPP_W_DATE_TIME): Added.
128 (cpp_options): Add warn_date_time.
129 * init.c (cpp_create_reader): Init it.
130 * macro.c (_cpp_builtin_macro_text): Warn when
131 __DATE__/__TIME__/__TIMESTAMP__ is used.
132
7057e645
ESR
1332013-10-31 Edward Smith-Rowland <3dw4rd@verizon.net>
134
e8ff5196 135 Implement C++14 digit separators.
7057e645
ESR
136 * include/cpplib.h (cpp_options): Add digit_separators flag.
137 * internal.h (DIGIT_SEP(c)): New macro.
138 * expr.c (cpp_classify_number): Check improper placement of digit sep;
139 (cpp_interpret_integer): Skip over digit separators.
140 * init.c (lang_flags): Add digit_separators flag; (lang_defaults): Add
141 digit separator flags per language; (cpp_set_lang): Set
142 digit_separators
143 * lex.c (lex_number): Add digits separator to allowable characters for
144 C++14.
145
459260ec
DM
1462013-10-15 David Malcolm <dmalcolm@redhat.com>
147
148 * Makefile.in (PICFLAG): New.
149 (ALL_CFLAGS): Add PICFLAG.
150 (ALL_CXXFLAGS): Likewise.
151 * configure.ac: Add --enable-host-shared, setting up new
152 PICFLAG variable.
153 * configure: Regenerate.
154
fd6eea0c
RE
1552013-08-07 Richard Earnshaw <rearnsha@arm.com>
156
157 * configure.ac: Set need_64bit_hwint for all arm targets.
158 * configure: Regenerated.
159
8cf88735
JJ
1602013-07-20 Jakub Jelinek <jakub@redhat.com>
161
162 PR preprocessor/57620
163 * lex.c (lex_raw_string): Undo phase1 and phase2 transformations
164 between R" and final " rather than only in between R"del( and )del".
165
87e356ba
JJ
1662013-07-10 Jakub Jelinek <jakub@redhat.com>
167
d5e48350
JJ
168 PR preprocessor/57824
169 * lex.c (lex_raw_string): Allow reading new-lines if
170 in_deferred_pragma or if parsing_args and there is still
171 data in the current buffer.
172
c26302d5
JJ
173 * include/cpplib.h (cpp_token_val_index): Change parameter type to
174 const cpp_token *.
175 * lex.c (cpp_token_val_index): Likewise.
176
87e356ba
JJ
177 PR preprocessor/57757
178 * lex.c (cpp_avoid_paste): Avoid pasting CPP_{,W,UTF8}STRING
179 or CPP_STRING{16,32} with CPP_NAME or SPELL_LITERAL token that
180 starts if a-zA-Z_.
181
c865f923
ESR
1822013-06-28 Ed Smith-Rowland <3dw4rd@verizon.net>
183
184 * lex.c (lex_raw_string(), lex_string()): Constrain suffixes treated
185 as concatenated literal and macro to just the patterns found in
186 inttypes.h; (is_macro()): New.
187
39953c79
DC
1882013-06-24 Dehao Chen <dehao@google.com>
189
190 * files.c (_cpp_stack_include): Fix the highest_location when header
191 file is guarded by #ifndef and is included twice.
192
01187df0
JJ
1932013-04-28 Jakub Jelinek <jakub@redhat.com>
194
195 N3472 binary constants
196 * include/cpplib.h (struct cpp_options): Fix a typo in user_literals
197 field comment. Add binary_constants field.
198 * init.c (struct lang_flags): Add binary_constants field.
199 (lang_defaults): Add bin_cst column to the table.
200 (cpp_set_lang): Initialize CPP_OPTION (pfile, binary_constants).
201 * expr.c (cpp_classify_number): Talk about C++11 instead of C++0x
202 in diagnostics. Accept binary constants if
203 CPP_OPTION (pfile, binary_constants) even when pedantic. Adjust
204 pedwarn message.
205
61949153
PC
2062013-04-24 Paolo Carlini <paolo.carlini@oracle.com>
207
208 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX1Y and CLK_CXX1Y.
209 * init.c (lang_defaults): Add defaults for the latter.
210 (cpp_init_builtins): Define __cplusplus as 201300L for the latter.
211 * lex.c (_cpp_lex_direct): Update.
212
994a4cc0
SH
2132013-04-03 Sebastian Huber <sebastian.huber@embedded-brains.de>
214
215 PR target/56771
216 * configure.ac: Require 64-bit int for arm*-*-rtems*.
217 * configure: Regenerate.
218
28937f11
JJ
2192013-03-06 Jakub Jelinek <jakub@redhat.com>
220
221 PR middle-end/56461
222 * internal.h (struct cpp_buffer): Add to_free field.
223 (_cpp_pop_file_buffer): Add third argument.
224 * files.c (_cpp_stack_file): Set buffer->to_free.
225 (_cpp_pop_file_buffer): Add to_free argument. Free to_free
226 if non-NULL, and if equal to file->buffer_start, also clear
227 file->buffer{,_start,_valid}.
228 * directives.c (_cpp_pop_buffer): Pass buffer->to_free
229 to _cpp_pop_file_buffer.
230
3b8af25b
JJ
2312013-03-01 Jakub Jelinek <jakub@redhat.com>
232
233 PR middle-end/56461
234 * files.c (_cpp_save_file_entries): Free result at the end.
235 * pch.c (cpp_string_free): New function.
236 (cpp_save_state): Use it in htab_create call.
237 (cpp_write_pch_deps): Free ss->defs. Destroy ss->definedhash.
238
1a80db97
JJ
2392013-02-28 Jakub Jelinek <jakub@redhat.com>
240
15fd8332
JJ
241 * files.c (_cpp_find_file): If returning early, before storing
242 something to *hash_slot and *hash_slot is NULL, call htab_clear_slot
243 on it. Access *hash_slot using void * type rather than
244 struct file_hash_entry * to avoid aliasing issues.
245
1a80db97
JJ
246 * configure.ac: Don't define ENABLE_CHECKING whenever
247 --enable-checking is seen, instead use similar --enable-checking=yes
248 vs. --enable-checking=release default as gcc/ subdir has and
249 define ENABLE_CHECKING if ENABLE_CHECKING is defined in gcc/.
250 Define ENABLE_VALGRIND_CHECKING if requested.
251 * lex.c (new_buff): If ENABLE_VALGRIND_CHECKING, put _cpp_buff
252 struct first in the allocated buffer and result->base after it.
253 (_cpp_free_buff): If ENABLE_VALGRIND_CHECKING, free buff itself
254 instead of buff->base.
255 * config.in: Regenerated.
256 * configure: Regenerated.
257
561f7fc7
ESR
2582013-02-13 Ed Smith-Rowland <3dw4rd@verizon.net>
259
260 PR c++/55582
61949153 261 * lex.c (lex_raw_string): Allow string literal with suffix
561f7fc7
ESR
262 beginning with 's' to be parsed as a C++11 user-defined literal.
263
500f3ed9
RS
2642013-01-14 Richard Sandiford <rdsandiford@googlemail.com>
265
266 Update copyright years.
267
1582c677
PC
2682013-01-04 Paolo Carlini <paolo.carlini@oracle.com>
269
270 PR c++/54526 (again)
271 * lex.c (_cpp_lex_direct): In C++11 mode, implement 2.5 p3, bullet 2.
272
8ac16127
MG
2732013-01-03 Marc Glisse <marc.glisse@inria.fr>
274
275 PR bootstrap/50177
276 * line-map.c (get_combined_adhoc_loc): Cast from extern "C" type.
277 (new_linemap): Likewise.
278 (linemap_enter_macro): Likewise.
279
f41e5bd1
JJ
2802012-12-03 Jakub Jelinek <jakub@redhat.com>
281
282 PR bootstrap/55380
283 PR other/54691
284 * files.c (read_file_guts): Allocate extra 16 bytes instead of
285 1 byte at the end of buf. Pass size + 16 instead of size
286 to _cpp_convert_input.
287 * charset.c (_cpp_convert_input): Reallocate if there aren't
288 at least 16 bytes beyond to.len in the buffer. Clear 16 bytes
289 at to.text + to.len.
290
31962032
SE
2912012-11-21 Steve Ellcey <sellcey@mips.com>
292
293 PR pch/55399
294 * files.c (pch_open_file): Fix check for implicit_preinclude.
295
5dc99c46
SB
2962012-11-16 Simon Baldwin <simonb@google.com>
297
298 * include/cpplib.h (struct cpp_options): Add canonical_system_headers.
299 * files.c (find_file_in_dir): Call maybe_shorter_path() only if
300 canonical_system_headers is set.
301 * init.c (cpp_create_reader): Initialize canonical_system_headers.
302 * configure.ac: Add new --enable-canonical-system-headers.
303 * configure: Regenerate.
304 * config.in: Regenerate.
305
a4a0016d
ESR
3062012-11-09 Ed Smith-Rowland <3dw4rd@verizon.net>
307
308 PR c++/54413
309 * include/cpplib.h (cpp_interpret_float_suffix): Add cpp_reader* arg.
310 (cpp_interpret_int_suffix): Add cpp_reader* arg.
311 * init.c (cpp_create_reader): Iitialize new flags.
312 * expr.c (interpret_float_suffix): Use new flags.
313 (cpp_interpret_float_suffix): Add cpp_reader* arg.
314 (interpret_int_suffix): Use new flags.
315 (cpp_interpret_int_suffix): Add cpp_reader* arg.
316 (cpp_classify_number): Adjust calls to interpret_x_suffix.
317
04ce690f
IB
3182012-10-23 Ian Bolton <ian.bolton@arm.com>
319 Jim MacArthur <jim.macarthur@arm.com>
320 Marcus Shawcroft <marcus.shawcroft@arm.com>
321 Nigel Stephens <nigel.stephens@arm.com>
322 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
323 Richard Earnshaw <rearnsha@arm.com>
324 Sofiane Naci <sofiane.naci@arm.com>
325 Stephen Thomas <stephen.thomas@arm.com>
326 Tejas Belagod <tejas.belagod@arm.com>
327 Yufeng Zhang <yufeng.zhang@arm.com>
328
329 * configure.ac: Enable AArch64.
330 * configure: Regenerate.
331
1efcb8c6
JM
3322012-10-23 Joseph Myers <joseph@codesourcery.com>
333
334 * files.c (struct _cpp_file): Add implicit_preinclude.
335 (pch_open_file): Allow a previously opened implicitly included
336 file.
337 (_cpp_find_file): Add implicit_preinclude argument. Free file and
338 do not call open_file_failed if implicit_preinclude. Store
339 implicit_preinclude value.
340 (_cpp_stack_include, _cpp_fake_include, _cpp_compare_file_date):
341 Update calls to _cpp_find_file.
342 (_cpp_stack_include): Handle IT_DEFAULT.
343 (cpp_push_default_include): New.
344 * include/cpplib.h (cpp_push_default_include): Declare.
345 * init.c (cpp_read_main_file): Update call to _cpp_find_file.
346 * internal.h (enum include_type): Add IT_DEFAULT.
347 (_cpp_find_file): Update prototype.
348
55e7f907
TB
3492012-10-15 Tobias Burnus <burnus@net-b.de>
350
351 * files.c (read_file_guts, _cpp_save_file_entries): Free memory
352 before returning.
353 * lex.c (warn_about_normalization): Ditto.
354 * mkdeps.c (deps_save): Ditto.
355 * pch.c (cpp_valid_state): Ditto.
356
f591bd8f
FW
3572012-10-04 Florian Weimer <fweimer@redhat.com>
358
359 * directives.c (do_pragma_warning_or_error): New.
360 (do_pragma_warning): New.
361 (do_pragma_error): New.
362 (_cpp_init_internal_pragmas): Register new pragmas.
363
ec6e0399
DC
3642012-09-25 Dehao Chen <dehao@google.com>
365
366 PR middle-end/54704
367 * line-map.c (location_adhoc_data_hash): Fix the hash function.
368
52187008
DC
3692012-09-25 Dehao Chen <dehao@google.com>
370
371 PR middle-end/54645
372 * include/line-map.h (location_adhoc_data): Move location_adhoc_data
373 into GC.
374 (location_adhoc_data_map): Likewise.
375 (line_maps): Likewise.
376 (rebuild_location_adhoc_htab): New Function.
377 * line-map.c (+rebuild_location_adhoc_htab): new Funcion.
378 (get_combined_adhoc_loc): Move location_adhoc_data into GC.
379 (location_adhoc_data_fini): Likewise.
380 (linemap_init): Likewise.
381 (location_adhoc_data_init): Remove Function.
382
5368224f
DC
3832012-09-19 Dehao Chen <dehao@google.com>
384
385 * include/line-map.h (MAX_SOURCE_LOCATION): New value.
386 (location_adhoc_data_fini): New.
387 (get_combined_adhoc_loc): New.
388 (get_data_from_adhoc_loc): New.
389 (get_location_from_adhoc_loc): New.
390 (location_adhoc_data_map): New.
391 (COMBINE_LOCATION_DATA): New.
392 (IS_ADHOC_LOC): New.
393 (expanded_location): New field.
394 (line_maps): New field.
395 * line-map.c (location_adhoc_data): New.
396 (location_adhoc_data_hash): New.
397 (location_adhoc_data_eq): New.
398 (location_adhoc_data_update): New.
399 (get_combined_adhoc_loc): New.
400 (get_data_from_adhoc_loc): New.
401 (get_location_from_adhoc_loc): New.
402 (location_adhoc_data_init): New.
403 (location_adhoc_data_fini): New.
404 (linemap_init): Initialize location_adhoc_data.
405 (linemap_lookup): Change to use new location.
406 (linemap_ordinary_map_lookup): Likewise.
407 (linemap_macro_map_lookup): Likewise.
408 (linemap_macro_map_loc_to_def_point): Likewise.
409 (linemap_macro_map_loc_unwind_toward_spel): Likewise.
410 (linemap_get_expansion_line): Likewise.
411 (linemap_get_expansion_filename): Likewise.
412 (linemap_location_in_system_header_p): Likewise.
413 (linemap_location_from_macro_expansion_p): Likewise.
414 (linemap_macro_loc_to_spelling_point): Likewise.
415 (linemap_macro_loc_to_def_point): Likewise.
416 (linemap_macro_loc_to_exp_point): Likewise.
417 (linemap_resolve_location): Likewise.
418 (linemap_unwind_toward_expansion): Likewise.
419 (linemap_unwind_to_first_non_reserved_loc): Likewise.
420 (linemap_expand_location): Likewise.
421 (linemap_dump_location): Likewise.
422 (linemap_line_start): Likewise.
423
f3d25c65
DS
4242012-05-25 Dodji Seketeli <dodji@redhat.com>
425
426 PR preprocessor/53469
427 * directives.c (do_pragma): Use the virtual location for the
428 pragma token, instead of its spelling location.
429
0823efed
DN
4302012-08-14 Diego Novillo <dnovillo@google.com>
431
432 Merge from cxx-conversion branch. Configury.
433
434 * Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
435 * configure.ac: Likewise.
436 * configure: Regenerate.
437
4382012-08-14 Lawrence Crowl <crowl@google.com>
439
440 Merge from cxx-conversion branch. New C++ hash table.
441
442 * include/symtab.h (typedef struct ht hash_table): Change the typedef
443 name to cpp_hash_table. Update all users of the typedef.
444
c0fd3497
LB
4452012-07-30 Laurynas Biveinis <laurynas.biveinis@gmail.com>
446
447 * include/line-map.h (line_map_macro): Use the "atomic" GTY option
448 for the macro_locations field.
449
d35d1c0f
UB
4502011-06-19 Uros Bizjak <ubizjak@gmail.com>
451
452 * lex.c (search_line_sse42): Use __builtin_ia32_loaddqu and
453 __builtin_ia32_pcmpestri128 instead of asm.
454
d86d2119
DA
4552012-06-04 Dimitrios Apostolou <jimis@gmx.net>
456
457 * line-map.c (linemap_enter_macro): Don't zero max_column_hint in
458 every macro. This improves performance by reducing the number of
459 reallocations when track-macro-expansion is on.
460
7ca643e1
DS
4612012-06-04 Dodji Seketeli <dodji@redhat.com>
462
463 PR preprocessor/53463
464 * line-map.c (linemap_location_in_system_header_p): For built-in
465 macro tokens, check the first expansion point location that is not
466 for a token coming from a built-in macro.
467
7d9641cc
JM
4682012-05-29 Joseph Myers <joseph@codesourcery.com>
469
470 * directives.c: Fix typos.
471 * include/line-map.h: Fix typos.
472 * line-map.c: Fix typos.
473 * macro.c: Fix typos.
474
53a103d3
DS
4752012-05-25 Dodji Seketeli <dodji@redhat.com>
476
477 PR bootstrap/53459
478 * lex.c (search_line_fast): Avoid unused local typedefs to simulate
479 a static assertion.
480
828a7f76
DS
4812012-05-29 Dodji Seketeli <dodji@redhat.com>
482
483 PR preprocessor/53229
484 * internal.h (cpp_reader::set_invocation_location): Remove.
485 (cpp_reader::about_to_expand_macro_p): New member flag.
486 * directives.c (do_pragma): Remove Kludge as
487 pfile->set_invocation_location is no more.
488 * macro.c (cpp_get_token_1): Do away with the use of
489 cpp_reader::set_invocation_location. Just collect the macro
490 expansion point when we are about to expand the top-most macro.
491 Do not override cpp_reader::about_to_expand_macro_p.
492 This fixes gcc.dg/cpp/paste12.c by making get_token_no_padding
493 properly handle locations of expansion points.
494 (cpp_get_token_with_location): Adjust, as
495 cpp_reader::set_invocation_location is no more.
496 (paste_tokens): Take a virtual location parameter for
497 the LHS of the pasting operator. Use it in diagnostics. Update
498 comments.
499 (paste_all_tokens): Tighten the assert. Propagate the location of
500 the expansion point when no virtual locations are available.
501 Pass the virtual location to paste_tokens.
502 (in_macro_expansion_p): New static function.
503 (enter_macro_context): Set the cpp_reader::about_to_expand_macro_p
504 flag until we really start expanding the macro.
505
0b2c4be5
DS
5062012-05-16 Dodji Seketeli <dodji@redhat.com>
507
508 PR preprocessor/7263
509 * include/cpplib.h (cpp_classify_number): Take a location
510 parameter.
511 * expr.c (SYNTAX_ERROR_AT, SYNTAX_ERROR2_AT): New diagnostic
512 macros that take a location parameter.
513 (cpp_classify_number): Take a (virtual) location parameter. Use
514 it for diagnostics. Adjust comments.
515 (eval_token): Take a location parameter. Pass it to
516 cpp_classify_number and to diagnostic routines.
517 (_cpp_parse_expr): Use virtual locations of tokens when parsing
518 expressions. Pass a virtual location to eval_token and to
519 diagnostic routines.
520
638d2065
TG
5212012-05-10 Tristan Gingold <gingold@adacore.com>
522
523 * expr.c (interpret_float_suffix): Add a guard.
524
3ad64f53
DS
5252012-05-02 Dodji Seketeli <dodji@redhat.com>
526
527 Properly initialize cpp_context in destringize_and_run
528 * directives.c (destringize_and_run): Properly initialize the new
529 context.
530 * macro.c (_cpp_pop_context): Assert that we shouldn't try to pop
531 the initial base context, which has the same life time as the
532 current instance of cpp_file.
533
b193dfa8
MLI
5342012-04-30 Manuel López-Ibáñez <manu@gcc.gnu.org>
535 Dodji Seketeli <dodji@seketeli.org>
536
3efc2959 537 PR c++/52974
b193dfa8
MLI
538 * libcpp/files.c (maybe_shorter_path): New.
539 (find_file_in_dir): Use it.
540
4e65a470
DS
5412012-04-30 Dodji Seketeli <dodji@redhat.com>
542
51fce2d3
DS
543 Switch -ftrack-macro-expansion=2 on by default.
544 * init.c (cpp_create_reader): Switch -ftrack-macro-expansion=2 on
545 by default. Add comments.
546
c4ca1a09
DS
547 Strip "<built-in>" loc from displayed expansion context
548 * include/line-map.h (linemap_unwind_toward_expansion): Fix typo
549 in comment.
550 (linemap_unwind_to_first_non_reserved_loc): Declare new function.
551 * line-map.c (linemap_unwind_to_first_non_reserved_loc): Define
552 new function.
553
3600218c
DS
554 Fix expansion point loc for macro-like tokens
555 * macro.c (macro_of_context): New static function.
556 (_cpp_push_token_context, push_extended_tokens_context): If the
557 macro argument is NULL, it means we are continuing the expansion
558 of the current macro, if any. Update comments.
559 (_cpp_pop_context): Re-enable expansion of the macro only when we
560 are really out of the context of the current expansion.
561
0ff2b8a0
DS
562 Fix token pasting with -ftrack-macro-expansion
563 * macro.c (paste_all_tokens): Put the token resulting from pasting
564 into an extended token context with -ftrack-macro-location is in
565 effect.
566
4e65a470
DS
567 Fix cpp_sys_macro_p with -ftrack-macro-expansion
568 * macro.c (cpp_sys_macro_p): Support -ftrack-macro-expansion.
569
112448b4
DS
5702012-04-29 Dodji Seketeli <dodji@redhat.com>
571
572 * lex.c (lex_raw_string): Change C++ style comments into C style
573 comments.
574 (lex_string): Likewise.
575
7f5f5f98
OW
5762012-04-27 Ollie Wild <aaw@google.com>
577
578 * include/cpplib.h (struct cpp_options): Add new field,
579 warn_literal_suffix.
580 (CPP_W_LITERAL_SUFFIX): New enum.
581 * init.c (cpp_create_reader): Default initialization of
582 warn_literal_suffix.
583 * lex.c (lex_raw_string): Treat user-defined literals which don't
584 begin with '_' as separate tokens and produce a warning.
585 (lex_string): Ditto.
586
1d72e96f
MLI
5872012-04-26 Manuel López-Ibáñez <manu@gcc.gnu.org>
588
589 * line-map.c (linemap_resolve_location): Synchronize comments with
590 those in line-map.h.
591 * include/line-map.h (linemap_resolve_location): Fix spelling in
592 comment.
593
e75b54a2
RE
5942012-03-22 Richard Earnshaw <rearnsha@arm.com>
595
596 * lex.c (search_line_fast): Provide Neon-optimized version for ARM.
597
7888f266
RO
5982012-03-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
599
600 * lex.c: Remove Solaris 8 reference.
601
dd552284
WL
6022012-02-14 Walter Lee <walt@tilera.com>
603
604 * configure.ac: Require 64-bit hwint for tilegx and tilepro.
605 * configure: Regenerate.
606
2c5cbc31
RG
6072012-01-09 Richard Guenther <rguenther@suse.de>
608
609 * macro.c (_cpp_builtin_macro_text): Remove unused variable map.
610
b492b686
GF
6112012-01-09 Gary Funck <gary@intrepid.com>
612
613 PR preprocessor/33919
614 * files.c (_cpp_get_file_name): New. Implement file name
615 access function.
616 * internal.h (_cpp_get_file_name): New prototype.
617 * macro.c (_cpp_builtin_macro_text): Call _cpp_get_file_name()
618 to use pfile->main_file in lieu of traversing INCLUDED_FROM chain.
619
75291c57
OH
6202012-01-03 Olivier Hainque <hainque@adacore.com>
621
622 * system.h: Prior to #define, #undef fopen and freopen unconditionally.
623
48b0b196
JM
6242011-12-20 Joseph Myers <joseph@codesourcery.com>
625
626 * include/cpplib.h (CLK_GNUC1X): Change to CLK_GNUC11.
627 (CLK_STDC1X): Change to CLK_STDC11.
628 * init.c (lang_defaults): Update comments.
629 (cpp_init_builtins): Update language tests. Use 201112L for C11
630 __STDC_VERSION__.
631
4a5e00ca
AS
6322011-12-20 Andreas Schwab <schwab@linux-m68k.org>
633
634 * configure: Regenerate.
635
095af58f
AS
6362011-12-19 Andreas Schwab <schwab@linux-m68k.org>
637
638 * configure: Regenerate.
639
b0c084b7
JJ
6402011-12-07 Jakub Jelinek <jakub@redhat.com>
641
642 PR bootstrap/50237
643 * internal.h (_cpp_init_lexer): New prototype.
644 * init.c (init_library): Call it.
645 * lex.c (init_vectorized_lexer): Remove constructor attribute,
646 add inline keyword.
647 (HAVE_init_vectorized_lexer): Define.
648 (_cpp_init_lexer): New function.
649
9b554be9
DS
6502011-12-03 Dodji Seketeli <dodji@redhat.com>
651
652 * macro.c (tokens_buff_remove_last_token)
653 (tokens_buff_put_token_to): Add an 'inline' function specifier to
654 the prototype.
655
8dcf72a8
DN
6562011-11-22 Diego Novillo <dnovillo@google.com>
657
658 * include/line-map.h (linemap_dump): Declare.
659 (line_table_dump): Declare.
660 * line-map.c (linemap_dump): New.
661 (line_table_dump): New.
662
7e74ce3f
ESR
6632011-11-21 Ed Smith-Rowland <3dw4rd@verizon.net>
664
665 PR c++/50958
666 * expr.c (cpp_userdef_char_remove_type): Fix typo.
667
e9411247
MM
6682011-11-03 Michael Matz <matz@suse.de>
669
670 PR bootstrap/50857
671 * configure.ac: Check for -fno-exceptions -fno-rtti.
672 * configure: Regenerate.
673 * Makefile.in (NOEXCEPTION_FLAGS): New flag.
674 (ALL_CXXFLAGS): Use it.
675
0c1dace3
PC
6762011-11-02 Paolo Carlini <paolo.carlini@oracle.com>
677
678 * internal.h (uxstrdup, ustrchr): Return const unsigned char *.
679
25339f10
JM
6802011-11-02 Jason Merrill <jason@redhat.com>
681
682 PR c++/50810
683 * configure.ac: Add -Wno-narrowing to warning options.
684
97e3ad20
JM
6852011-10-31 Jason Merrill <jason@redhat.com>
686
1fb80b0c
JM
687 PR libstdc++/1773
688 * init.c (cpp_init_builtins): Set __cplusplus for C++11.
689
97e3ad20
JM
690 PR c++/50920
691 * include/cpplib.h (enum c_lang): Rename CLK_CXX0X to CLK_CXX11,
692 CLK_GNUCXX0X to CLK_GNUCXX11.
693
3ce4f9e4
ESR
6942011-10-26 Ed Smith-Rowland <3dw4rd@verizon.net>
695
696 Implement C++11 user-defined literals.
697 * expr.c: (cpp_interpret_float_suffix, cpp_interpret_int_suffix,
698 cpp_userdef_string_remove_type, cpp_userdef_string_add_type,
699 cpp_userdef_char_remove_type, cpp_userdef_char_add_type,
700 cpp_userdef_string_p, cpp_userdef_char_p, cpp_get_userdef_suffix): New.
701 (cpp_classify_number): Classify unrecognized tokens as user-defined
702 literals.
703 * include/cpplib.h: Add new tokens for user-defined literals.
704 * init.c: Add new preprocessor flag (cxx11).
705 * lex.c: (lex_string, lex_raw_string): Handle user-defined literals
706 including concatenation and promotion with suffixes.
707
3bb0c8db
DS
7082011-10-24 Dodji Seketeli <dodji@redhat.com>
709
710 * line-map.c (linemap_macro_map_lookup): Fix logic.
711
84756fd4
DS
7122011-10-24 Dodji Seketeli <dodji@redhat.com>
713
714 * include/line-map.h (linemap_expand_location): Take a line table
715 parameter. Update comment.
716 (linemap_resolve_location): Update comment.
717 (linemap_expand_location_full): Remove.
718 * line-map.c (linemap_resolve_location): Handle reserved
719 locations; return a NULL map in those cases.
720 (linemap_expand_location): If location is reserved, return a
721 zeroed expanded location. Update comment. Take a line table to
722 assert that the function takes non-virtual locations only.
723 (linemap_expand_location_full): remove.
724 (linemap_dump_location): Handle the fact that
725 linemap_resolve_location can return NULL line maps when the
726 location resolves to a reserved location.
727
728 * line-map.c (linemap_macro_map_lookup): Fix logic.
729
ad2305ad
DS
7302011-10-22 Dodji Seketeli <dodji@redhat.com>
731
732 PR bootstrap/50778
733 * include/internal.h (_cpp_remaining_tokens_num_in_context): Take the
734 context to act upon.
735 * lex.c (_cpp_remaining_tokens_num_in_context): Likewise. Update
736 comment.
737 (cpp_token_from_context_at): Likewise.
738 (cpp_peek_token): Use the context to peek tokens from.
739
cbbcf655
DS
7402011-10-20 Dodji Seketeli <dodji@redhat.com>
741
742 PR bootstrap/50801
743 * lex.c (_cpp_remaining_tokens_num_in_context): Fix computation of
744 number of tokens.
745
d17687f6
DS
7462011-10-18 Dodji Seketeli <dodji@redhat.com>
747
748 PR bootstrap/50760
749 * include/line-map.h (struct linemap_stats): Change the type of
750 the members from size_t to long.
751 * macro.c (macro_arg_token_iter_init): Unconditionally initialize
752 iter->location_ptr.
753
411f92de
DS
7542011-10-17 Dodji Seketeli <dodji@redhat.com>
755
756 * line-map.c (linemap_macro_map_loc_to_exp_point): Avoid setting a
757 variable without using it if ENABLE_CHECKING is not defined. Mark
758 the LOCATION parameter as being unused.
759
b9bd6f74
TT
7602011-10-15 Tom Tromey <tromey@redhat.com>
761 Dodji Seketeli <dodji@redhat.com>
762
763 * include/line-map.h (struct line_maps::alloced_size_for_request):
764 New member.
765 * line-map.c (new_linemap): Use set->alloced_size_for_request to
766 get the actual allocated size of line maps.
767
64a1a422
TT
7682011-10-15 Tom Tromey <tromey@redhat.com>
769 Dodji Seketeli <dodji@redhat.com>
770
771 * line-map.h (struct linemap_stats): Declare new struct.
772 (linemap_get_statistics): Declare ...
773 * line-map.c (linemap_get_statistics): ... new function.
774 * macro.c (num_expanded_macros_counter, num_macro_tokens_counter):
775 Declare new counters.
776 (enter_macro_context, replace_args): Update
777 num_macro_tokens_counter.
778 (cpp_get_token_1): Update num_expanded_macros_counter.
779
847e697a
TT
7802011-10-15 Tom Tromey <tromey@redhat.com>
781 Dodji Seketeli <dodji@redhat.com>
782
783 * include/cpplib.h (struct cpp_options)<debug>: New struct member.
784 * include/line-map.h (linemap_dump_location): Declare ...
785 * line-map.c (linemap_dump_location): ... new function.
786
92582b75
TT
7872011-10-15 Tom Tromey <tromey@redhat.com>
788 Dodji Seketeli <dodji@redhat.com>
789
790 * include/cpplib.h (struct cpp_options)<track_macro_expansion>:
791 New option.
792 * internal.h (struct macro_context): New struct.
793 (enum context_tokens_kind): New enum.
794 (struct cpp_context)<tokens_kind>: New member of type enum
795 context_tokens_kind.
796 (struct cpp_context)<macro>: Remove this. Replace it with an enum
797 of macro and macro_context.
798 (struct cpp_context)<direct_p>: Remove.
799 (_cpp_remaining_tokens_num_in_context): Declare new function.
800 * directives.c (destringize_and_run): Adjust.
801 * lex.c (_cpp_remaining_tokens_num_in_context)
802 (_cpp_token_from_context_at): Define new functions
803 (cpp_peek_token): Use them.
804 * init.c (cpp_create_reader): Initialize the base context to zero.
805 (_cpp_token_from_context_at): Define new static function.
806 (cpp_peek_token): Use new _cpp_remaining_tokens_num_in_context and
807 _cpp_token_from_context_at.
808 * macro.c (struct macro_arg)<virt_locs, expanded_virt_locs>: New
809 members.
810 (enum macro_arg_token_kind): New enum.
811 (struct macro_arg_token_iter): New struct.
812 (maybe_adjust_loc_for_trad_cpp, push_extended_tokens_context)
813 (alloc_expanded_arg_mem, ensure_expanded_arg_room)
814 (delete_macro_args, set_arg_token, get_arg_token_location)
815 (arg_token_ptr_at, macro_arg_token_iter_init)
816 (macro_arg_token_iter_get_token)
817 (macro_arg_token_iter_get_location, macro_arg_token_iter_forward)
818 (expanded_token_index, tokens_buff_new, tokens_buff_count)
819 (tokens_buff_last_token_ptr, tokens_buff_put_token_to)
820 (tokens_buff_add_token, tokens_buff_remove_last_token)
821 (reached_end_of_context, consume_next_token_from_context): New
822 static functions.
823 (cpp_get_token_1): New static function. Split and extended from
824 cpp_get_token. Use reached_end_of_context and
825 consume_next_token_from_context. Unify its return point. Move
826 the location tweaking from cpp_get_token_with_location in here.
827 (cpp_get_token): Use cpp_get_token_1
828 (stringify_arg): Use the new arg_token_at.
829 (paste_all_tokens): Support tokens coming from extended tokens
830 contexts.
831 (collect_args): Return the number of collected arguments, by
832 parameter. Store virtual locations of tokens that constitute the
833 collected args.
834 (funlike_invocation_p): Return the number of collected arguments,
835 by parameter.
836 (enter_macro_context): Add a parameter for macro expansion point.
837 Pass it to replace_args and to the "used" cpp callback. Get the
838 number of function-like macro arguments from funlike_invocation_p,
839 pass it to the new delete_macro_args to free the memory used by
840 macro args. When -ftrack-macro-expansion is in effect, for macros
841 that have no arguments, create a macro map for the macro expansion
842 and use it to allocate proper virtual locations for tokens
843 resulting from the expansion. Push an extended tokens context
844 containing the tokens resulting from macro expansion and their
845 virtual locations.
846 (replace_args): Rename the different variables named 'count' into
847 variables with more meaningful names. Create a macro map;
848 allocate virtual locations of tokens resulting from this
849 expansion. Use macro_arg_token_iter to iterate over tokens of a
850 given macro. Handle the case of the argument of
851 -ftrack-macro-expansion being < 2. Don't free macro arguments
852 memory resulting from expand_arg here, as these are freed by the
853 caller of replace_arg using delete_macro_args now. Push extended
854 token context.
855 (next_context, push_ptoken_context, _cpp_push_token_context)
856 (_cpp_push_text_context): Properly initialize the context.
857 (expand_arg): Use the new alloc_expanded_arg_mem,
858 push_extended_tokens_context, cpp_get_token_1, and set_arg_token.
859 (_cpp_pop_context): Really free the memory held by the context.
860 Handle freeing memory used by extended tokens contexts.
861 (cpp_get_token_with_location): Use cpp_get_token_1.
862 (cpp_sys_macro_p): Adjust.
863 (_cpp_backup_tokens): Support the new kinds of token contexts.
864 * traditional.c (recursive_macro): Adjust.
865
46427374
TT
8662011-10-15 Tom Tromey <tromey@redhat>
867 Dodji Seketeli <dodji@redhat.com>
868
869 * include/line-map.h (enum lc_reason)<LC_ENTER_MACRO>: New enum
870 member.
871 (MAX_SOURCE_LOCATION): New constant.
872 (struct line_map_ordinary, struct line_map_macro): New structs.
873 (struct line_map): Turn this into a union of the two above. Add
874 comments.
875 (struct maps_info): New struct.
876 (struct line_maps)<info_ordinary, info_macro>: Two new fields.
877 These now carry the map information that was previously scattered
878 in struct line_maps.
879 (struct map_info::allocated): Fix comment.
880 (MAP_START_LOCATION, ORDINARY_MAP_FILE_NAME)
881 (ORDINARY_MAP_STARTING_LINE_NUMBER)
882 (ORDINARY_MAP_INCLUDER_FILE_INDEX)
883 (ORDINARY_MAP_IN_SYSTEM_HEADER_P)
884 (ORDINARY_MAP_NUMBER_OF_COLUMN_BITS, MACRO_MAP_MACRO)
885 (MACRO_MAP_NUM_MACRO_TOKENS MACRO_MAP_LOCATIONS)
886 (MACRO_MAP_EXPANSION_POINT_LOCATION)
887 (LOCATION_POSSIBLY_IN_MACRO_MAP_P, LINEMAPS_MAP_INFO)
888 (LINEMAPS_MAPS, LINEMAPS_ALLOCATE, LINEMAPS_USED, LINEMAPS_CACHE)
889 (LINEMAPS_LAST_MAP, LINEMAPS_LAST_ALLOCATED_MAP)
890 (LINEMAPS_ORDINARY_MAPS, LINEMAPS_ORDINARY_ALLOCATED)
891 (LINEMAPS_ORDINARY_USED, LINEMAPS_ORDINARY_CACHE)
892 (LINEMAPS_LAST_ORDINARY_MAP, LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP)
893 (LINEMAPS_MACRO_MAPS, LINEMAPS_MACRO_ALLOCATED)
894 (LINEMAPS_MACRO_USED, LINEMAPS_MACRO_CACHE)
895 (LINEMAPS_LAST_MACRO_MAP, LINEMAPS_LAST_ALLOCATED_MACRO_MAP)
896 (LINEMAPS_MAP_AT, LINEMAPS_ORDINARY_MAP_AT)
897 (LINEMAPS_MACRO_MAP_AT): New accessors for ordinary and macro map
898 information.
899 (linemap_check_ordinary, linemap_assert)
900 (linemap_location_before_p): New macros.
901 (linemap_position_for_line_and_column)
902 (linemap_tracks_macro_expansion_locs_p, linemap_add_macro_token)
903 (linemap_macro_expansion_map_p)
904 (linemap_macro_map_loc_to_def_point)
905 (linemap_macro_map_loc_unwind_once)
906 (linemap_macro_map_loc_to_exp_point, linemap_step_out_once)
907 (linemap_get_source_line linemap_get_source_column)
908 (linemap_map_get_macro_name, linemap_get_file_path)
909 (linemap_location_in_system_header_p)
910 (linemap_location_from_macro_expansion_p): Declare new functions.
911 (SOURCE_LINE, SOURCE_COLUMN, LAST_SOURCE_LINE_LOCATION)
912 (LINEMAP_FILE, LINEMAP_LINE, LINEMAP_SYSP): Assert that this
913 accessors act on ordinary maps only.
914 (INCLUDED_FROM): Return NULL for main files; use the new
915 accessors.
916 (LINEMAP_POSITION_FOR_COLUMN): Use the new accessors.
917 (struct expanded_location): Move here from gcc/input.h
918 (linemap_resolve_location, linemap_expand_location)
919 (linemap_expand_location_full): Declare new functions.
920 * line-map.c: Include cpplib.h, internal.h
921 (linemap_enter_macro, linemap_add_macro_token)
922 (linemap_get_expansion_line, linemap_get_expansion_filename): New
923 functions that are private to libcpp.
924 (linemap_assert): New macro.
925 (linemap_macro_loc_to_exp_point, linemap_macro_loc_to_exp_point)
926 (linemap_macro_loc_unwind, linemap_macro_map_loc_to_def_point)
927 (linemap_macro_map_loc_unwind_toward_spelling)
928 (linemap_macro_map_loc_to_exp_point)
929 (first_map_in_common_1, first_map_in_common): New static
930 functions.
931 (new_linemap): Define new static functions. Extracted and
932 enhanced from ...
933 (linemap_add): ... here. Use linemap_assert in lieu of abort
934 previously.
935 (linemap_tracks_macro_expansion_locs_p)
936 (linemap_add_macro_token, linemap_macro_expansion_map_p)
937 (linemap_check_ordinary, linemap_macro_map_loc_to_exp_point)
938 (linemap_macro_map_loc_to_def_point)
939 (linemap_macro_map_loc_unwind_once)
940 (linemap_step_out_once, linemap_map_get_index)
941 (linemap_get_source_line,linemap_get_source_column)
942 (linemap_get_file_path, linemap_map_get_macro_name)
943 (linemap_location_in_system_header_p)
944 (linemap_location_originated_from_system_header_p)
945 (linemap_location_from_macro_expansion_p)
946 (linemap_tracks_macro_expansion_locs_p)
947 (linemap_resolve_location, linemap_expand_location)
948 (linemap_expand_location_full)
949 (linemap_tracks_macro_expansion_locs_p)
950 (linemap_position_for_line_and_column, linemap_compare_locations):
951 Define new public functions.
952 (linemap_init): Initialize ordinary and macro maps information in
953 the map set.
954 (linemap_check_files_exited): Use the new accessors.
955 (linemap_free): Remove this dead code.
956 (linemap_line_start): Assert this uses an ordinary map. Adjust to
957 use the new ordinary map accessors and data structures. Don't
958 overflow past the lowest possible macro token's location.
959 (linemap_position_for_column): Assert the ordinary maps of the map
960 set are really ordinary. Use ordinary map accessors.
961 (linemap_lookup): Keep the same logic but generalize to allow
962 lookup of both ordinary and macro maps. Do not crash when called
963 with an empty line table.
964 * directives-only.c (_cpp_preprocess_dir_only): Adjust to use the
965 new API of line-map.h.
966 * directives.c (start_directive, do_line, do_linemarker)
967 (do_linemarker): Likewise.
968 * files.c (_cpp_find_file, _cpp_stack_include, open_file_failed)
969 (make_cpp_dir, cpp_make_system_header): Likewise.
970 * init.c (cpp_read_main_file): Likewise.
971 * internal.h (CPP_INCREMENT_LINE): Likewise.
972 (linemap_enter_macro, linemap_add_macro_token)
973 (linemap_get_expansion_line, linemap_get_expansion_filename): New
974 functions private to libcpp.
975 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment)
976 (skip_line_comment, skip_whitespace, lex_raw_string)
977 (_cpp_lex_direct): Likewise.
978 * macro.c (_cpp_builtin_macro_text): Likewise.
979 (_cpp_aligned_alloc): Initialize the new name member of the macro.
980 * traditional.c (copy_comment, _cpp_scan_out_logical_line):
981 Likewise.
982 * errors.c (cpp_diagnostic): Adjust to new linemap API.
983
892a371f
DS
9842011-08-28 Dodji Seketeli <dodji@redhat.com>
985
986 * line-map.c (linemap_add): Assert that reason must not be
987 LC_RENAME when called for the first time on a "main input file".
988
e3dfef44
GC
9892011-08-22 Gabriel Charette <gchare@google.com>
990
991 * init.c (cpp_create_reader): Inititalize forced_token_location_p.
992 * internal.h (struct cpp_reader): Add field forced_token_location_p.
993 * lex.c (_cpp_lex_direct): Use forced_token_location_p.
994 (cpp_force_token_locations): New.
995 (cpp_stop_forcing_token_locations): New.
996
32fe396e
RO
9972011-08-18 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
998
999 PR libstdc++/1773
1000 * init.c (cpp_init_builtins): Define __cplusplus 19971L.
1001
7c1ffff9
JM
10022011-08-18 Joseph Myers <joseph@codesourcery.com>
1003
1004 * include/cpplib.h (struct cpp_options): Fix typo.
1005
a48e3dd1
JM
10062011-08-18 Joseph Myers <joseph@codesourcery.com>
1007
1008 * include/cpplib.h (struct cpp_options): Add rliterals.
1009 * init.c (struct lang_flags, lang_defaults): Add rliterals.
1010 (cpp_set_lang): Set rliterals option.
1011 (cpp_init_builtins): Define __STDC_UTF_16__ and __STDC_UTF_32__.
1012 * lex.c (_cpp_lex_direct): Only accept raw strings if rliterals.
1013
3f6ced10
GC
10142011-08-15 Gabriel Charette <gchare@google.com>
1015
1016 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Remove.
1017 Update all users to use linemap_position_for_column instead.
1018
0681d04c
GC
10192011-07-28 Gabriel Charette <gchare@google.com>
1020
1021 * include/line-map.h (struct line_maps):
1022 Remove unused field last_listed. Update all users.
1023
5e9627ca
L
10242011-07-28 H.J. Lu <hongjiu.lu@intel.com>
1025
1026 * configure.ac: Set need_64bit_hwint to yes for x86 targets.
1027 * configure: Regenerated.
1028
a024b70f
RO
10292011-07-25 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1030
1031 * system.h [__cplusplus]: Wrap C function declarations in extern "C".
1032
5b6d595b
RO
10332011-07-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1034 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1035
1036 PR bootstrap/49794
1037 * configure.ac: Test AM_ICONV with CXX.
1038 * configure: Regenerate.
1039 * system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
1040
d0a9fbe1
DS
10412011-07-15 Dodji Seketeli <dodji@redhat.com>
1042
1043 * directives.c (struct if_stack): Use source_location as type
1044 here.
1045 * include/cpplib.h (struct cpp_callbacks)<include, define, undef,
1046 indent, def_pragma, used_define, used_undef>: Properly use
1047 source_location as parameter type, rather than unsigned int.
1048
fbdd5d87
RO
10492011-07-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1050
1051 PR target/39150
1052 * configure.ac (host_wide_int): Handle x86_64-*-solaris2.1[0-9]
1053 like i[34567]86-*-solaris2.1[0-9]*.
1054 * configure: Regenerate.
1055
8787a05a
JM
10562011-06-16 Jason Merrill <jason@redhat.com>
1057
1058 PR c++/45399
1059 * lex.c (lex_raw_string): Don't check for embedded NUL.
1060
38fbfaf6
DS
10612011-06-06 Dodji Seketeli <dodji@redhat.com>
1062
1063 PR preprocessor/48532
1064 * directives.c (do_pragma): Don't forget the invocation location
1065 when parsing the pragma name of a namespaced pragma directive.
1066
fc0993ac
JT
10672011-05-29 John Tytgat <John.Tytgat@aaug.net>
1068
1069 * files.c (read_file_guts): Add test on non-zero value of S_ISREG.
1070
ef230b38
UB
10712011-05-22 Uros Bizjak <ubizjak@gmail.com>
1072
1073 PR target/49104
1074 * lex.c (init_vectorized_lexer): Do not set "minimum" when __3dNOW_A__
1075 is defined. Check bit_MMXEXT and bit_CMOV to use search_line_mmx.
1076
e5b0dad8
JK
10772011-04-25 Jan Kratochvil <jan.kratochvil@redhat.com>
1078
1079 * system.h (ENUM_BITFIELD): Remove.
1080
6cfae070
JJ
10812011-04-24 Jakub Jelinek <jakub@redhat.com>
1082
1083 PR preprocessor/48740
1084 * lex.c (lex_raw_string): When raw string ends with
1085 ??) followed by raw prefix and ", ensure it is preprocessed
1086 with ??) rather than ??].
1087
04695783
JM
10882011-04-20 Jim Meyering <meyering@redhat.com>
1089
1090 * files.c (destroy_cpp_file): Remove useless if-before-free.
1091 * init.c (cpp_destroy): Likewise.
1092 * macro.c (replace_args): Likewise.
1093 * pch.c (cpp_valid_state): Likewise.
1094
4489800d
KT
10952011-03-25 Kai Tietz <ktietz@redhat.com>
1096
1097 * files.c (file_hash_eq): Use filename_cmp
1098 instead of strcmp.
1099 (nonexistent_file_hash_eq): Likewise.
1100 (remap_filename): Likewise.
1101 Handle absolute DOS-path,
1102 (append_file_to_dir): Check for IS_DIR_SEPARATOR
1103 instead of slash.
1104 (read_name_map): Likewise.
1105 * linemap.c (linemap_add): Use filename_cmp
1106 instead of strcmp.
1107 * mkdeps.c (apply_vpath): Use filename_ncmp
1108 instead of strncmp.
1109 (deps_restore): Use filename_cmp instead of
1110 strcmp.
1111 * init.c (read_original_directory): Use
1112 IS_DIR_SEPARATOR instead of checking for slash.
1113
f3c33d9d
MM
11142011-03-21 Michael Meissner <meissner@linux.vnet.ibm.com>
1115
1116 PR preprocessor/48192
1117 * directives.c (do_ifdef): Do not consider conditional macros as
1118 being defined.
1119 (do_ifndef): Ditto.
1120 * expr.c (parse_defined): Ditto.
1121
01956319
RH
11222011-03-18 Richard Henderson <rth@redhat.com>
1123
1124 PR bootstrap/45381
1125 * lex.c [ALTIVEC] (search_line_fast): Require gcc version 4.5.
1126
c5a62c6f
EB
11272011-11-04 Eric Botcazou <ebotcazou@adacore.com>
1128 Jakub Jelinek <jakub@redhat.com>
1129
1130 PR preprocessor/39213
1131 * directives.c (end_directive): Call _cpp_remove_overlay for deferred
1132 pragmas as well in traditional mode.
1133
0e1a989c
ILT
11342010-11-17 Ian Lance Taylor <iant@google.com>
1135
1136 PR bootstrap/45538
1137 * configure.ac: Use AC_USE_SYSTEM_EXTENSIONS. Remove switch of
1138 AC_LANG based on ENABLE_BUILD_WITH_CXX.
1139
651a20b5
KT
11402010-11-16 Kai Tietz <kai.tietz@onevision.com>
1141
1142 PR preprocessor/17349
1143 * lex.c (save_comment): Handle in argument passing c++
1144 comments special.
1145
480767a9
ILT
11462010-11-02 Ian Lance Taylor <iant@google.com>
1147
1148 * configure.ac: Use AC_SYS_LARGEFILE.
1149 * configure: Rebuild.
1150 * config.in: Rebuild.
1151
078419c9 11522010-10-19 Basile Starynkevitch <basile@starynkevitch.net>
480767a9 1153
078419c9
BS
1154 * line-map.h (source_location): Remove obsolete comment
1155 mentioning location_s.
1156
d6874138
KT
11572010-09-29 Kai Tietz <kai.tietz@onevision.com>
1158
1159 PR preprocessor/45362
1160 * directives.c (cpp_pop_definition): Make static.
1161 (do_pragma_push_macro): Reworked to store text
1162 definition.
1163 (do_pragma_pop_macro): Add free text definition.
1164 (cpp_push_definition): Removed.
1165 * include/cpplib.h (cpp_push_definition): Removed.
1166 (cpp_pop_definition): Likewise.
1167 * internal.h (def_pragma_macro): Remove member 'value'
1168 and add new members 'definition', 'line',
1169 'syshdr', 'sued' and 'is_undef'.
1170 * pch.c (_cpp_restore_pushed_macros): Rework to work
1171 on text definition and store additional macro flags.
1172 (_cpp_save_pushed_macros): Likewise.
1173
e3339d0f
JM
11742010-09-29 Joseph Myers <joseph@codesourcery.com>
1175
1176 * include/cpplib.h (cpp_options): Rename warn_deprecated,
1177 warn_traditional, warn_long_long and pedantic.
1178 * directives.c (directive_diagnostics, _cpp_handle_directive):
1179 Update names of cpp_options members.
1180 * expr.c (cpp_classify_number, eval_token): Update names of
1181 cpp_options members.
1182 * init.c (cpp_create_reader, post_options): Update names of
1183 cpp_options members.
1184 * internal.h (CPP_PEDANTIC, CPP_WTRADITIONAL): Update names of
1185 cpp_options members.
1186 * macro.c (parse_params): Update names of cpp_options members.
1187
128465e6
ILT
11882010-09-15 Ian Lance Taylor <iant@google.com>
1189
1190 * init.c: Fix type name in comment.
1191
a69d2520
JJ
11922010-08-31 Jakub Jelinek <jakub@redhat.com>
1193
1194 PR preprocessor/45457
1195 * expr.c (parse_defined): Call pfile->cb.user_builtin_macro hook if
1196 needed.
1197 * directives.c (do_ifdef, do_ifndef): Likewise.
1198
707bcb7a
RO
11992010-08-26 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1200
1201 * system.h [HAVE_INTTYPES_H]: Include inttypes.h.
1202
6f173e52
RH
12032010-08-24 Richard Henderson <rth@redhat.com>
1204
1205 PR bootstrap/45376
1206 * configure.ac (HAVE_SSE4): New check.
1207 * configure, config.in: Rebuild.
1208 * lex.c (search_line_sse42): Omit if !HAVE_SSE4.
1209
789d73cb
RO
12102010-08-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
1211
1212 * lex.c [__sun__ && __svr4__]: Disable init_vectorized_lexer
1213 etc. on Solaris 2/x86.
1214
246a2fcb
RH
12152010-08-21 Richard Henderson <rth@redhat.com>
1216 Andi Kleen <ak@linux.intel.com>
1217 David S. Miller <davem@davemloft.net>
1218
1219 * configure.ac (AC_C_BIGENDIAN, AC_TYPE_UINTPTR_T): New tests.
1220 (ssize_t): Check via AC_TYPE_SSIZE_T instead of AC_CHECK_TYPE.
1221 (ptrdiff_t): Check via AC_CHECK_TYPE.
1222 * config.in, configure: Rebuild.
1223 * system.h: Include stdint.h, if available.
1224 * lex.c (WORDS_BIGENDIAN): Provide default.
1225 (acc_char_mask_misalign, acc_char_replicate, acc_char_cmp,
1226 acc_char_index, search_line_acc_char, repl_chars, search_line_mmx,
1227 search_line_sse2, search_line_sse42, init_vectorized_lexer,
1228 search_line_fast): New.
1229 (_cpp_clean_line): Use search_line_fast. Restructure the fast
1230 loop to make it clear when we're leaving the loop. Stay in the
1231 fast loop for non-trigraph '?'.
1232
8e680db5
JJ
12332010-06-11 Jakub Jelinek <jakub@redhat.com>
1234
1235 * include/cpplib.h (struct cpp_callbacks): Add user_builtin_macro
1236 callback.
1237 (enum cpp_builtin_type): Add BT_FIRST_USER and BT_LAST_USER.
1238 (cpp_macro_definition): Remove const qual from second argument.
1239 * macro.c (enter_macro_context): Call user_builtin_macro callback for
1240 NODE_BUILTIN !NODE_USED macros.
1241 (warn_of_redefinition): Likewise. Remove const qual from second
1242 argument.
1243 (cpp_macro_definition): Likewise.
1244 * pch.c (write_macdef, save_macros): Call user_builtin_macro callback
1245 for NODE_BUILTIN !NODE_USED macros.
1246
1cb42611
JM
12472010-06-10 Joseph Myers <joseph@codesourcery.com>
1248
1249 * include/cpplib.h (struct cpp_options): Remove show_column.
1250 * init.c (cpp_create_reader, post_options): Don't set show_column.
1251
ff5dfc48
JR
12522010-06-09 Joern Rennecke <joern.rennecke@embecosm.com>
1253
1254 PR bootstrap/44432
1255 * configure.ac: Before using ZW_PROG_COMPILER_DEPENDENCIES for C++,
1256 check that C++ compiler works.
1257 * configure: Regenerate.
1258
a9429e29
LB
12592010-06-08 Laurynas Biveinis <laurynas.biveinis@gmail.com>
1260
1261 * include/symtab.h (ht_identifier_ptr): New.
1262
c3f247f4
RW
12632010-06-03 Joern Rennecke <joern.rennecke@embecosm.com>
1264 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1265
1266 PR bootstrap/42798
1267 * configure.ac: Check for declaration of 'basename(char *)'.
1268 * configure: Regenerate.
1269 * config.in: Regenerate.
1270
2778d766
JM
12712010-04-25 Joseph Myers <joseph@codesourcery.com>
1272
1273 * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
1274 * init.c (lang_defaults): Add entries for new language variants.
1275 (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
1276 variants.
1277
d8a12e84
MLI
12782010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
1279
1280 PR cpp/43195
1281 * files.c (report_missing_guard): Test for #pragma once.
1282
87cf0651
SB
12832010-04-07 Simon Baldwin <simonb@google.com>
1284
1285 * directives.c (do_diagnostic): Add warning reason argument,
1286 call appropriate error reporting function for code.
1287 (directive_diagnostics): Call specific warning functions with
1288 warning reason where appropriate.
1289 (do_error, do_warning, do_pragma_dependency): Add warning reason
1290 argument to do_diagnostic calls.
1291 * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
1292 _cpp_create_definition): Call specific warning functions with
1293 warning reason where appropriate.
1294 * Makefile.in: Add new diagnostic functions to gettext translations.
1295 * include/cpplib.h (struct cpp_callbacks): Add warning reason code
1296 to error callback.
1297 (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
1298 CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
1299 (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
1300 CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
1301 CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
1302 CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
1303 CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
1304 CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
1305 CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
1306 warning reason codes.
1307 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
1308 cpp_warning_with_line, cpp_pedwarning_with_line,
1309 cpp_warning_with_line_syshdr): New specific error reporting functions.
1310 * pch.c (cpp_valid_state): Call specific warning functions with
1311 warning reason where appropriate.
1312 * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
1313 diagnostic handlers.
1314 (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
1315 cpp_warning_with_line, cpp_pedwarning_with_line,
1316 cpp_warning_with_line_syshdr): New specific error reporting functions.
1317 * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
1318 specific warning functions with warning reason where appropriate.
1319 * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
1320 warn_about_normalization, lex_identifier_intern, lex_identifier,
1321 _cpp_lex_direct): Ditto.
1322 * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
1323 narrow_str_to_charconst): Ditto.
1324
d947ada0
JJ
13252010-04-06 Jakub Jelinek <jakub@redhat.com>
1326
1327 PR preprocessor/43642
1328 * lex.c (lex_raw_string): Change type of TYPE variable to
1329 unsigned char.
1330
4d9e8446
RW
13312010-04-02 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1332
1333 * aclocal.m4: Regenerate.
1334
52150625
JM
13352010-03-29 Jason Merrill <jason@redhat.com>
1336
00a81b8b
JM
1337 More N3077 raw string changes
1338 * charset.c (cpp_interpret_string): Don't transform UCNs in raw
1339 strings.
1340 * lex.c (bufring_append): Split out from...
1341 (lex_raw_string): ...here. Undo trigraph and line splicing
1342 transformations. Do process line notes in multi-line literals.
1343 (_cpp_process_line_notes): Ignore notes that were already handled.
1344
52150625
JM
1345 Some raw string changes from N3077
1346 * charset.c (cpp_interpret_string): Change inner delimiters to ().
1347 * lex.c (lex_raw_string): Likewise. Also disallow '\' in delimiter.
1348
709d7160
JJ
13492010-02-11 Jakub Jelinek <jakub@redhat.com>
1350
1351 * init.c (read_original_filename): Don't call read_original_directory
1352 if _cpp_handle_directive returns 0.
1353
dadab4fd
JM
13542010-01-01 Joseph Myers <joseph@codesourcery.com>
1355
1356 PR preprocessor/41947
1357 * expr.c (cpp_classify_number): Give error for hexadecimal
1358 floating-point constant with no digits before or after point.
1359
3de8a540
AC
13602009-11-20 Arnaud Charlet <charlet@adacore.com>
1361
1362 * macro.c (enter_macro_context): Call cb.used callback if defined.
1363 * directives.c (do_idef, do_ifndef): Ditto.
1364 * include/cpplib.h (struct cpp_callbacks): Add used callback.
1365
17e7cb85
KT
13662009-11-11 Kai Tietz <kai.tietz@onevision.com>
1367
1368 * directives.c (do_pragma_push_macro): New pragma handler.
1369 (do_pragma_pop_macro): Likewise.
1370 (_cpp_init_internal_pragmas): Add push_macro and
1371 pop_macro handler to internal pragmas.
1372 (lex_macro_node_from_str): Removed.
1373 (cpp_push_definition): Replace lex_macro_node_from_str
1374 by _cpp_lex_identifier.
1375 (cpp_pop_definition): Likewise.
1376 * internal.h (_cpp_lex_identifier): New prototype.
1377 (def_pragma_macro): New structure.
1378 (cpp_reader): New member pushed_macros.
1379 * lex.c (_cpp_lex_identifier): New function.
1380 (lex_identifier_intern): New function.
1381 * init.c (cpp_create_reader): Initialize pushed_macros
1382 member.
1383 (cpp_destroy): Free elements in pushed_macros member.
1384 * pch.c (_cpp_save_pushed_macros): New function.
1385 (_cpp_restore_pushed_macros): Likewise.
1386 (_cpp_restore_pushed_macros): Use _cpp_save_pushed_macros.
1387 (cpp_read_state): Use _cpp_restore_pushed_macros.
1388
2c6e3f55
JJ
13892009-10-19 Jakub Jelinek <jakub@redhat.com>
1390
1391 * charset.c (cpp_init_iconv): Initialize utf8_cset_desc.
1392 (_cpp_destroy_iconv): Destroy utf8_cset_desc, char16_cset_desc
1393 and char32_cset_desc.
1394 (converter_for_type): Handle CPP_UTF8STRING.
1395 (cpp_interpret_string): Handle CPP_UTF8STRING and raw-strings.
1396 * directives.c (get__Pragma_string): Handle CPP_UTF8STRING.
1397 (parse_include): Reject raw strings.
1398 * include/cpplib.h (CPP_UTF8STRING): New token type.
1399 * internal.h (struct cpp_reader): Add utf8_cset_desc field.
1400 * lex.c (lex_raw_string): New function.
1401 (lex_string): Handle u8 string literals, call lex_raw_string
1402 for raw string literals.
1403 (_cpp_lex_direct): Call lex_string even for u8" and {,u,U,L,u8}R"
1404 sequences.
1405 * macro.c (stringify_arg): Handle CPP_UTF8STRING.
1406
96c169e1
JJ
14072009-10-14 Jakub Jelinek <jakub@redhat.com>
1408
1409 PR preprocessor/41543
1410 * include/line-map.h (RESERVED_LOCATION_COUNT): Define.
1411 * line-map.c (linemap_init): Initialize highest_location and
1412 highest_line to RESERVED_LOCATION_COUNT-1 instead of 0.
1413
30c99a9e
JM
14142009-10-09 Jason Merrill <jason@redhat.com>
1415
1416 * charset.c (_cpp_valid_ucn): Update C++0x restrictions.
1417
2214382c
NV
14182009-10-09 Neil Vachharajani <nvachhar@google.com>
1419
1420 * directives.c (DIRECTIVE_TABLE): Remove DEPRECATED from ident and
1421 sccs.
1422
e02222d2
LR
14232009-09-23 Loren J. Rittle <ljrittle@acm.org>
1424
1425 * configure.ac (AC_CHECK_HEADERS after AC_LANG(C++)): Add sys/stat.h.
1426 * configure: Rebuilt.
1427
9a8a2b7a
RG
14282009-09-22 Richard Guenther <rguenther@suse.de>
1429
1430 PR pch/38987
1431 * files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
1432
74dc6a11
CD
14332009-09-18 Chris Demetriou <cgd@google.com>
1434
1435 PR preprocessor/28435:
1436 * include/cpplib.h (struct cpp_options): Add new member
1437 deps.need_preprocessor_output.
1438 * files.c (open_file_failed): If preprocessor output is needed
1439 always report an error.
1440
933608b7
KT
14412009-09-13 Kai Tietz <kai.tietz@onevision.com>
1442
1443 * configure.ac: Set for i?86-w64-mingw*
1444 need_64bit_hwint to yes.
1445 * configure: Regenerated.
1446
86373e7e
JM
14472009-09-10 Jason Merrill <jason@redhat.com>
1448
1449 * directives.c (cpp_define): constify.
1450
fd2ab214
ILT
14512009-09-02 Ian Lance Taylor <iant@google.com>
1452
1453 * macro.c (stringify_arg): Escape CPP_WCHAR tokens.
1454
df58e648
RW
14552009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1456
1457 * configure.ac (AC_PREREQ): Bump to 2.64.
1458
5213506e
RW
14592009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1460
1461 * aclocal.m4: Regenerate.
1462 * config.in: Regenerate.
1463 * configure: Regenerate.
1464
709a22df
TT
14652009-08-17 Tom Tromey <tromey@redhat.com>
1466
1467 PR preprocessor/41067:
1468 * charset.c (convert_escape): Add missing ":" to error text.
1469
0c539b47
DR
14702009-07-27 Douglas B Rupp <rupp@gnat.com>
1471
1472 * include/cpplib.h (INO_T_CPP): New macro.
1473 (struct cpp_dir): Use it.
1474
2b69c841
JQ
14752009-07-20 Jerry Quinn <jlquinn@optonline.net>
1476
1477 PR regression/40800
1478 * configure.ac: Use = instead of == for testing
1479 ENABLE_BUILD_WITH_CXX.
1480 * configure: Rebuild.
1481
f1bf410c
JQ
14822009-07-17 Jerry Quinn <jlquinn@optonline.net>
1483
1484 * directives.c (do_linemarker, do_line): Use CPP_STRING for
1485 ignored enum value.
1486 * files.c (find_file_in_dir): Add cast from void* to char*.
1487 * symtab.c (ht_lookup_with_hash): Add cast from void* to char*.
1488 * Makefile.in: (WARN_CFLAGS): Use general and C-specific
1489 warnings.
1490 (CXX, CXXFLAGS, WARN_CXXFLAGS, ALL_CXXFLAGS,
1491 ENABLE_BUILD_WITH_CXX, CCDEPMODE, CXXDEPMODE, COMPILER,
1492 COMPILER_FLAGS): New.
1493 (DEPMODE): Set from CCDEPMODE or CXXDEPMODE.
1494 (COMPILE.base): Use COMPILER instead of CC. Use COMPILER_FLAGS
1495 instead of ALL_CFLAGS.
1496 * configure.ac: Invoke AC_PROG_CXX. Separate C-specific warnings
1497 from other warnings. Add -Wc++-compat to C-specific warnings.
1498 Check for --enable-build-with-cxx. Set and substitute
1499 ENABLE_BUILD_WITH_CXX. Invoke ZW_PROG_COMPILER_DEPENDENCIES
1500 according to ENABLE_BUILD_WITH_CXX. Invoke AC_LANG before
1501 AC_CHECK_HEADERS.
1502 * configure: Rebuild.
1503 * include/cpp-id-data.h: Remove extern "C".
1504 * include/line-map.h: Likewise.
1505 * include/mkdeps.h: Likewise.
1506 * include/symtab.h: Likewise.
1507 * internal.h: Likewise.
1508
a28fbdba
MLI
15092009-06-23 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1510
1511 * directives.c (parse_include): Add location argument. Update all
1512 calls.
1513 (parse_answer): Likewise.
1514 (do_include_common): Error with exact location.
1515 (parse_assertion): Likewise.
1516
b506a5a2
MLI
15172009-06-18 Manuel López-Ibáñez <manu@gcc.gnu.org>
1518
1519 * expr.c (num_div_op): Take explicit location.
1520
7d8847a4
ILT
15212009-06-17 Ian Lance Taylor <iant@google.com>
1522
1523 * include/cpplib.h (progname): Don't declare.
1524
3d8b2a98
ILT
15252009-06-12 Ian Lance Taylor <iant@google.com>
1526
1527 * include/cpplib.h (struct cpp_options): Add
1528 warn_cxx_operator_names field.
1529 (NODE_WARN_OPERATOR): Define.
1530 (struct cpp_hashnode): Increase flags field to 10 bits, decrease
1531 type to 6 bits.
1532 * init.c (mark_named_operators): Add flags parameter.
1533 (cpp_post_options): Pick flags value to pass to
1534 mark_named_operators.
1535 * lex.c (lex_identifier): If NODE_WARN_OPERATOR is set, warn that
1536 identifier is an operator name in C++.
1537
e74fe492
AH
15382009-06-01 Aldy Hernandez <aldyh@redhat.com>
1539
1540 * include/line-map.h (LAST_SOURCE_COLUMN): New.
1541
4851089f
ILT
15422009-06-01 Ian Lance Taylor <iant@google.com>
1543
1544 * include/cpp-id-data.h: Add extern "C".
1545 * include/line-map.h: Likewise.
1546 * include/mkdeps.h: Likewise.
1547 * include/symtab.h: Likewise.
1548 * internal.h: Likewise.
1549
7e5487a2
ILT
15502009-05-15 Ian Lance Taylor <iant@google.com>
1551
1552 * include/cpplib.h (enum cpp_builtin_type): Rename from enum
1553 builtin_type. Change all uses.
1554
00b0c19b
MLI
15552009-05-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1556
1557 PR cpp/36674
1558 * directives (do_linemarker): Compensate for the increment in
1559 location that occurs when we reach the end of line.
1560 * files (_cpp_stack_include): Mention _cpp_find_file in the
1561 comment.
1562
9a0c6187
JM
15632009-05-10 Joseph Myers <joseph@codesourcery.com>
1564
1565 * include/cpplib.h (enum cpp_token_fld_kind): Add
1566 CPP_TOKEN_FLD_TOKEN_NO.
1567 (struct cpp_macro_arg, struct cpp_identifier): Define.
1568 (union cpp_token_u): Use struct cpp_identifier for identifiers.
1569 Use struct cpp_macro_arg for macro arguments. Add token_no for
1570 CPP_PASTE token numbers.
1571 * directives.c (_cpp_handle_directive, lex_macro_node, do_pragma,
1572 do_pragma_poison, parse_assertion): Use val.node.node in place of
1573 val.node.
1574 * expr.c (parse_defined, eval_token): Use val.node.node in place
1575 of val.node.
1576 * lex.c (cpp_ideq, _cpp_lex_direct, cpp_token_len,
1577 cpp_spell_token, cpp_output_token, _cpp_equiv_tokens,
1578 cpp_token_val_index): Use val.macro_arg.arg_no or val.token_no in
1579 place of val.arg_no. Use val.node.node in place of val.node.
1580 * macro.c (replace_args, cpp_get_token, parse_params,
1581 lex_expansion_token, create_iso_definition, cpp_macro_definition):
1582 Use val.macro_arg.arg_no or val.token_no in place of val.arg_no.
1583 Use val.node.node in place of val.node.
1584
9e322bc1
JM
15852009-05-03 Joseph Myers <joseph@codesourcery.com>
1586
1587 * charset.c (one_utf8_to_cppchar): Correct mask used for 5-byte
1588 UTF-8 sequences.
1589
f88d0772
JM
15902009-04-25 Joseph Myers <joseph@codesourcery.com>
1591
1592 PR preprocessor/39559
1593 * expr.c (cpp_interpret_integer): Use a pedwarn for decimal
1594 constants larger than intmax_t in C99 mode.
1595
d1b38208
TG
15962009-04-21 Taras Glek <tglek@mozilla.com>
1597
1598 * include/cpp-id-data.h: Update GTY annotations to new syntax.
1599 * include/cpplib.h: Likewise.
1600 * include/line-map.h: Likewise.
1601 * include/symtab.h: Likewise.
1602
cfc93532
MLI
16032009-04-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1604
1605 PR c++/14875
1606 * lex.c (cpp_type2name): Take a flags parameter. Call
1607 cpp_named_operator2name for named operators and cpp_digraph2name
1608 for digraphs.
1609 (cpp_digraph2name): New.
1610 (cpp_spell_token): Use it.
1611 (cpp_output_token): Likewise.
1612 * include/cpplib.h (cpp_type2name): Update declaration.
1613 * init.c (cpp_named_operator2name): New.
1614 * internal.h (cpp_named_operator2name): Declare.
1615
9c650d90
MLI
16162009-04-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1617
1618 PR c++/13358
1619 * init.c (cpp_create_reader): Wlong_long is disabled by default.
1620 * expr.c (cpp_classify_number): Give different messages for C and
1621 C++ front-ends.
1622
aa508502
JM
16232009-04-19 Joseph Myers <joseph@codesourcery.com>
1624
1625 PR preprocessor/20078
1626 * include/cpp-id-data.h (struct cpp_macro): Add extra_tokens
1627 field.
1628 * include/cpplib.h (SP_DIGRAPH, SP_PREV_WHITE): Define.
1629 (struct cpp_token): Change flags to unsigned short.
1630 * lex.c (_cpp_lex_direct): Initialize arg_no for CPP_PASTE tokens.
1631 (_cpp_equiv_tokens): Check arg_no for CPP_PASTE tokens.
1632 (cpp_token_val_index): Return CPP_TOKEN_FLD_ARG_NO for CPP_PASTE
1633 tokens.
1634 * macro.c (macro_real_token_count): New.
1635 (enter_macro_context, replace_args): Use macro_real_token_count.
1636 (create_iso_definition): Record whitespace surrounding and digraph
1637 spelling of # and ## tokens using SP_PREV_WHITE and SP_DIGRAPH.
1638 Set extra_tokens and save CPP_PASTE tokens with arg_no set for
1639 multiple consecutive ## tokens.
1640 (_cpp_create_definition): Initialize extra_tokens.
1641 (cpp_macro_definition): Use macro_real_token_count.
1642
61cc8223
JM
16432009-04-18 Joseph Myers <joseph@codesourcery.com>
1644
1645 * directives.c (parse_include): Pass true to check_eol.
1646
c7f9c0b9
JM
16472009-04-18 Joseph Myers <joseph@codesourcery.com>
1648
1649 PR preprocessor/39646
1650 * include/line-map.h (enum lc_reason): Add LC_RENAME_VERBATIM.
1651 * line-map.c (linemap_add): Handle LC_RENAME_VERBATIM.
1652 * directives.c (do_line, do_linemarker): Use LC_RENAME_VERBATIM in
1653 place of LC_RENAME.
1654
a5cb563b
JM
16552009-04-18 Joseph Myers <joseph@codesourcery.com>
1656
1657 PR preprocessor/39647
1658 * directives.c (check_eol): Add parameter expand.
1659 (do_undef, parse_include, do_line, do_linemarker, do_ident,
1660 do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
1661 do_else, do_endif, do_assert, do_unassert): All callers changed.
1662 Pass true from do_line, false elsewhere.
1663
18f41a1b
JM
16642009-04-12 Joseph Myers <joseph@codesourcery.com>
1665
1666 PR preprocessor/31869
1667 * macro.c (stringify_arg): Handle NULL source token in padding
1668 token where previous padding token did not have source token with
1669 preceding whitespace.
1670
748086b7
JJ
16712009-04-09 Jakub Jelinek <jakub@redhat.com>
1672
1673 * Makefile.in: Change copyright header to refer to version
1674 3 of the GNU General Public License and to point readers at the
1675 COPYING3 file and the FSF's license web page.
1676 * charset.c: Likewise.
1677 * directives-only.c: Likewise.
1678 * directives.c: Likewise.
1679 * errors.c: Likewise.
1680 * expr.c: Likewise.
1681 * files.c: Likewise.
1682 * identifiers.c: Likewise.
1683 * include/cpp-id-data.h: Likewise.
1684 * include/cpplib.h: Likewise.
1685 * include/line-map.h: Likewise.
1686 * include/mkdeps.h: Likewise.
1687 * include/symtab.h: Likewise.
1688 * init.c: Likewise.
1689 * internal.h: Likewise.
1690 * lex.c: Likewise.
1691 * line-map.c: Likewise.
1692 * macro.c: Likewise.
1693 * makeucnid.c: Likewise.
1694 * mkdeps.c: Likewise.
1695 * pch.c: Likewise.
1696 * symtab.c: Likewise.
1697 * system.h: Likewise.
1698 * traditional.c: Likewise.
1699 * ucnid.tab: Likewise.
1700 * ucnid.h: Regenerate.
1701
eec49116
JJ
17022009-04-01 Janis Johnson <janis187@us.ibm.com>
1703
839a3b8a
JJ
1704 PR c/39027
1705 * include/cpplib.h (CPP_N_DEFAULT): Define.
1706 * expr.c (interpret_float_suffix): Recognize d or D for double,
1707 return new value for default.
1708 (cpp_classify_number): Issue pedwarn for use of d or D in suffix.
1709
eec49116
JJ
1710 PR c/33466
1711 * expr.c (interpret_float_suffix): Reject invalid suffix that uses
1712 letters from decimal float and fixed-point suffixes.
1713
47580d22
JM
17142009-03-31 Joseph Myers <joseph@codesourcery.com>
1715
1716 PR preprocessor/15638
1717 * files.c (_cpp_find_file): Call open_file_failed after diagnosing
1718 invalid PCH.
1719 (open_file_failed): Make error for missing file fatal.
1720 * include/cpplib.h (CPP_DL_FATAL): Define.
1721
5a2df0fa
SV
17222009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
1723
1724 PR preprocessor/31932:
1725 * internal.h: Don't mention HAVE_ICONV_H.
1726 * configure, config.in: Rebuild.
1727 * configure.ac: Don't check for iconv.h.
1728
c1a8a3c6
TT
17292009-03-30 Tom Tromey <tromey@redhat.com>
1730
1731 PR preprocessor/39512:
1732 * line-map.c (linemap_init): Initialize 'reallocator' field.
1733
a37a7b8a
JJ
17342009-03-30 Jakub Jelinek <jakub@redhat.com>
1735
1736 PR target/39558
1737 * macro.c (cpp_get_token): If macro_to_expand returns NULL
1738 and used some tokens, add CPP_PADDING before next token.
1739
148e4216
JM
17402009-03-29 Joseph Myers <joseph@codesourcery.com>
1741
1742 PR preprocessor/34695
1743 * makedepend.c: Remove.
1744 * Makefile.in (makedepend_OBJS, makedepend$(EXEEXT)): Remove.
1745 (all, clean, TAGS_SOURCES, include): Remove makedepend handling.
1746 * directives.c (cpp_errors): Remove.
1747 * errors.c (print_location, _cpp_begin_message, v_message):
1748 Remove.
1749 (cpp_error, cpp_error_with_line): Always use error callback.
1750 (cpp_error, cpp_error_with_line, cpp_errno): Return bool.
1751 * include/cpplib.h (cpp_options): Remove pedantic_errors,
1752 inhibit_warnings, warn_system_headers, inhibit_errors,
1753 warnings_are_errors, client_diagnostic.
1754 (cpp_callbacks): Add extra arguments to error callback; make it
1755 return bool.
1756 (cpp_finish): Return void.
1757 (cpp_destroy): Remove inaccurate comment about return value.
1758 (cpp_errors, CPP_DL_EXTRACT, CPP_DL_WARNING_P): Remove.
1759 (CPP_DL_NOTE): Define.
1760 * include/line-map.h (linemap_print_containing_files): Remove.
1761 * init.c (cpp_finish): Do not check for or return number of
1762 errors.
1763 * internal.h (cpp_reader): Remove errors field.
1764 * line-map.c (linemap_print_containing_files): Remove.
1765 * macro.c (_cpp_create_definition): Use CPP_DL_NOTE for message
1766 about previous definition. Only emit it if previous diagnostic
1767 was emitted.
1768
f1450211
JM
17692009-03-28 Joseph Myers <joseph@codesourcery.com>
1770
1771 * Makefile.in (po/$(PACKAGE).pot): Use $(mkinstalldirs) not
1772 mkinstalldirs.
1773
8f5929e1
JJ
17742009-03-18 Jakub Jelinek <jakub@redhat.com>
1775
1776 * include/cpplib.h (struct cpp_dir): Reorder fields for 64-bit hosts.
1777
4bb09c26
JM
17782009-02-21 Joseph Myers <joseph@codesourcery.com>
1779
1780 * lex.c (lex_string): Return a CPP_LESS token for missing '>' in a
1781 header name.
1782 (_cpp_lex_direct): Handle this.
1783
68c9ab45
RG
17842009-02-15 Richard Guenther <rguenther@suse.de>
1785
1786 Revert last change.
1787
601b3e1a
RG
17882009-02-13 Richard Guenther <rguenther@suse.de>
1789
1790 * configure.ac: Enable LFS.
1791 * configure: Re-generate.
1792 * config.in: Likewise.
1793
fc0cd180
BE
17942009-01-05 Ben Elliston <bje@au.ibm.com>
1795
1796 * Makefile.in (.po.gmo): Use mkinstalldirs, not test -d || mkdir.
1797 (.po.pox): Likewise.
1798 (po/$(PACKAGE).pot): Likewise.
1799
db89a3be
AO
18002008-12-10 Alexandre Oliva <aoliva@redhat.com>
1801
1802 PR target/37033
1803 * pch.c (cpp_valid_state): Improve message for poisoned symbols.
1804 Allow for differences in __GCC_HAVE_DWARF2_CFI_ASM.
1805
cc955282
JM
18062008-11-29 Joseph Myers <joseph@codesourcery.com>
1807
1808 * lex.c (cpp_token_len): Use 6 as default length.
1809
47960aaf
MLI
18102008-10-31 Manuel López-Ibáñez <manu@gcc.gnu.org>
1811
1812 * expr.c (struct op): Add location.
1813 (_cpp_parse_expr): Propagate locations throught the stack
1814 of expressions.
1815 (reduce): Likewise.
1816 (check_promotion): Use explicit location in errors.
1817
631d0d36
MG
18182008-10-05 Matthew Gingell <gingell@adacore.com>
1819 Arnaud Charlet <charlet@adacore.com>
1820
1821 * include/cpplib.h (cpp_comments, cpp_comment_table): New structs.
1822 (cpp_get_comments): New function.
1823 * internal.h (struct cpp_reader): Add comments field.
1824 * init.c (cpp_destroy): Free comments.
1825 * lex.c (store_comment, cpp_get_comments): New functions.
1826 (comments): New struct.
1827 (save_comment): Store comments in comments struct.
1828
c047ce93
SB
18292008-09-18 Simon Baldwin <simonb@google.com>
1830
1831 * include/cpplib.h (struct cpp_options): Add new boolean flag
1832 warn_builtin_macro_redefined.
1833 * init.c (cpp_create_reader): Initialize warn_builtin_macro_redefined.
1834 * (struct builtin_operator): Split out from previous struct builtin,
1835 enhance extra const correctness.
1836 * (struct builtin_macro): Split out from previous struct builtin, add
1837 new always_warn_if_redefined flag, enhance const correctness.
1838 * (mark_named_operators): Use struct builtin_operator.
1839 * (cpp_init_special_builtins): Use struct builtin_macro, add NODE_WARN
1840 to builtins selectively.
1841 * macro.c (warn_of_redefinition): Return false if a builtin macro
1842 is not flagged with NODE_WARN.
1843
affa55c6
JJ
18442008-07-31 Jakub Jelinek <jakub@redhat.com>
1845
1846 PR preprocessor/36649
1847 * files.c (struct report_missing_guard_data): New type.
1848 (report_missing_guard): Put paths into an array instead of printing
1849 them right away. Return 1 rather than 0.
1850 (report_missing_guard_cmp): New function.
1851 (_cpp_report_missing_guards): Sort and print paths gathered by
1852 report_missing_guard callback.
1853
3b8f20a1
MLI
18542008-07-22 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1855
1856 PR 28079
1857 * directives.c (strtolinenum): Handle overflow.
1858 (do_line): Give a warning if line number overflowed.
1859 (do_linemarker): Update call to strtolinenum.
1860
1bb64668
MLI
18612008-07-21 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
1862
1863 * include/line-map.h (linenum_type): New typedef.
1864 (struct line_map): Use it.
1865 (SOURCE_LINE): Second arguments is a LOCATION not a LINE.
1866 (SOURCE_COLUMN): Likewise.
1867 * macro.c (_cpp_builtin_macro_text): Use linenum_type. Don't store
1868 source_location values in a variable of type linenum_type.
1869 * directives.c (struct if_stack): Use linenum_type.
1870 (strtoul_for_line): Rename as strtolinenum.
1871 (do_line): Use linenum_type.
1872 (do_linemarker): Use linenum_type and strtolinenum.
1873 (_cpp_do_file_change): Use linenum_t.
1874 * line-map.c (linemap_add): Likewise.
1875 (linemap_line_start): Likewise.
1876 * traditional.c (struct fun_macro): 'line' is a source_location.
1877 * errors.c (print_location): Use linenum_type.
1878 * directives-only.c (_cpp_preprocess_dir_only): Likewise.
1879 * internal.h (CPP_INCREMENT_LINE): Likewise.
1880 * lex.c (_cpp_skip_block_comment): Use source_location.
1881
5950c3c9
BE
18822008-07-14 Ben Elliston <bje@au.ibm.com>
1883
1884 * include/cpplib.h (NODE_CONDITIONAL): New.
1885 (struct cpp_callbacks): New macro_to_expand field.
1886 (struct cpp_hashnode): Adjust size of flags and type fields.
1887 (cpp_peek_token): Prototype.
1888 * lex.c (cpp_peek_token): New function.
1889 (_cpp_temp_token): Protect pre-existing lookaheads.
1890 * macro.c (cpp_get_token): Expand any conditional macros.
1891 (_cpp_backup_tokens_direct): New.
1892 (_cpp_backup_tokens): Call _cpp_backup_tokens_direct.
1893 (warn_of_redefinition): Silently allow redefined conditional
1894 macros.
1895 (_cpp_create_definition): Remove the conditional flag when a user
1896 defines one of the conditional macros.
1897 * internal.h (_cpp_backup_tokens_direct): New prototype.
1898
e85edc9e
AH
18992008-06-13 Andrew Haley <aph@redhat.com>
1900
1901 PR preprocessor/33305
1902 * macro.c (replace_args): Print a warning for empty macro
1903 arguments in C89 and C++.
1904
18c04407
RW
19052008-06-17 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1906
1907 * Makefile.in ($(srcdir)/aclocal.m4): Update dependencies.
1908 * configure: Regenerate.
1909
2d09b640
RW
19102008-06-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1911
1912 * Makefile.in (datarootdir): New variable.
1913
0b7c73cc
L
19142008-06-12 H.J. Lu <hongjiu.lu@intel.com>
1915
1916 PR preprocessor/36479
1917 * charset.c (cpp_interpret_string_notranslate): Also set
1918 narrow_cset_desc.width.
1919
cd985f66
JM
19202008-06-07 Joseph Myers <joseph@codesourcery.com>
1921
1922 * configure.ac (parisc*64*-*-*): Remove.
1923 * configure: Regenerate.
1924
d750887f
TT
19252008-05-30 Tom Tromey <tromey@redhat.com>
1926
1927 PR preprocessor/36320:
1928 * internal.h (_cpp_parse_expr): Update.
1929 * expr.c (_cpp_parse_expr): Add 'is_if' argument. Update error
1930 messages.
1931 * directives.c (do_if): Update.
1932 (do_elif): Require expression if processing group.
1933
c100de59
DS
19342008-05-30 Danny Smith <dannysmith@users.sourceforge.net>
1935
1936 * include/cpplib.h (struct cpp_dir): Add new field, canonical_name.
1937
5d6342eb
TT
19382008-05-21 Tom Tromey <tromey@redhat.com>
1939
1940 PR preprocessor/27777:
1941 * lex.c (cpp_output_line_to_string): New function.
1942 * internal.h (_cpp_begin_message): Don't declare.
1943 * errors.c (_cpp_begin_message): Now static.
1944 * include/cpplib.h (cpp_output_line_to_string): Declare.
1945 * directives.c (do_diagnostic): Rewrote. Use
1946 cpp_output_line_to_string. Don't use _cpp_begin_message.
1947
dae4174e
TT
19482008-05-21 Tom Tromey <tromey@redhat.com>
1949
1950 * include/symtab.h (HT_ALLOCED): Remove.
1951 (ht_purge): Declare.
1952 * symtab.c (DELETED): New define.
1953 (ht_lookup): Update comment.
1954 (ht_lookup_with_hash): Handle deleted entries. Remove HT_ALLOCED
1955 code. Use subobject allocator for strings, if it exists.
1956 (ht_expand): Handle deleted entries.
1957 (ht_forall): Likewise.
1958 (ht_purge): New function.
1959 (ht_dump_statistics): Print deletion statistics.
1960
899015a0
TT
19612008-05-13 Tom Tromey <tromey@redhat.com>
1962
1963 PR preprocessor/22168:
1964 * include/cpplib.h (struct cpp_options) <objc>: Update
1965 documentation.
1966 * expr.c (eval_token): Warn for use of assertions.
1967 * directives.c (directive_diagnostics): Warn about extensions.
1968 (DEPRECATED): New define.
1969 (DIRECTIVE_TABLE): Use it.
1970
71c10038
TT
19712008-05-06 Tom Tromey <tromey@redhat.com>
1972
1973 PR preprocessor/35313, PR preprocessor/36088:
1974 * expr.c (optab) <QUERY, COMMA>: Set precedence to 4.
1975 (reduce) <case CPP_QUERY>: Special case CPP_COMMA and CPP_COLON.
1976
2bd0fe3d
DM
19772008-05-04 David S. Miller <davem@davemloft.net>
1978
1979 * configure.ac (sparc*-*-*): Always set need_64bit_hwint to yes.
1980 * configure: Regenerate.
1981
28f68625
DF
19822008-04-22 Daniel Franke <franke.daniel@gmail.com>
1983
1984 * include/cpplib.h (cpp_define_formatted): New.
1985 * directives.c (cpp_define_formatted): New.
1986
688e7a53
TT
19872008-04-21 Tom Tromey <tromey@redhat.com>
1988
1989 PR libcpp/33415:
1990 * charset.c (_cpp_convert_input): Add buffer_start argument.
1991 Ignore UTF-8 BOM if seen.
1992 * internal.h (_cpp_convert_input): Add argument.
1993 * files.c (struct _cpp_file) <buffer_start>: New field.
1994 (destroy_cpp_file): Free buffer_start, not buffer.
1995 (_cpp_pop_file_buffer): Likewise.
1996 (read_file_guts): Update.
1997
b6baa67d
KVH
19982008-04-18 Kris Van Hees <kris.van.hees@oracle.com>
1999
2000 * include/cpp-id-data.h (UC): Was U, conflicts with U"..." literal.
2001 * include/cpplib.h (CHAR16, CHAR32, STRING16, STRING32): New tokens.
2002 (struct cpp_options): Added uliterals.
2003 (cpp_interpret_string): Update prototype.
2004 (cpp_interpret_string_notranslate): Idem.
2005 * charset.c (init_iconv_desc): New width member in cset_converter.
2006 (cpp_init_iconv): Add support for char{16,32}_cset_desc.
2007 (convert_ucn): Idem.
2008 (emit_numeric_escape): Idem.
2009 (convert_hex): Idem.
2010 (convert_oct): Idem.
2011 (convert_escape): Idem.
2012 (converter_for_type): New function.
2013 (cpp_interpret_string): Use converter_for_type, support u and U prefix.
2014 (cpp_interpret_string_notranslate): Match changed prototype.
2015 (wide_str_to_charconst): Use converter_for_type.
2016 (cpp_interpret_charconst): Add support for CPP_CHAR{16,32}.
2017 * directives.c (linemarker_dir): Macro U changed to UC.
2018 (parse_include): Idem.
2019 (register_pragma_1): Idem.
2020 (restore_registered_pragmas): Idem.
2021 (get__Pragma_string): Support CPP_STRING{16,32}.
2022 * expr.c (eval_token): Support CPP_CHAR{16,32}.
2023 * init.c (struct lang_flags): Added uliterals.
2024 (lang_defaults): Idem.
2025 * internal.h (struct cset_converter) <width>: New field.
2026 (struct cpp_reader) <char16_cset_desc>: Idem.
2027 (struct cpp_reader) <char32_cset_desc>: Idem.
2028 * lex.c (digraph_spellings): Macro U changed to UC.
2029 (OP, TK): Idem.
2030 (lex_string): Add support for u'...', U'...', u"..." and U"...".
2031 (_cpp_lex_direct): Idem.
2032 * macro.c (_cpp_builtin_macro_text): Macro U changed to UC.
2033 (stringify_arg): Support CPP_CHAR{16,32} and CPP_STRING{16,32}.
2034
deb984e6
PB
20352008-04-18 Paolo Bonzini <bonzini@gnu.org>
2036
2037 PR bootstrap/35457
2038 * aclocal.m4: Regenerate.
2039 * configure: Regenerate.
2040
bf048bea
TT
20412008-04-17 Tom Tromey <tromey@redhat.com>
2042
2043 PR libcpp/34866:
2044 * errors.c (cpp_error): Don't reference a token before the start
2045 of the current run.
2046
7f27b0f8
TT
20472008-04-16 Tom Tromey <tromey@redhat.com>
2048
2049 * Makefile.in (TAGS_SOURCES): New variable.
2050 (TAGS): New target.
2051
a1fcb9a1
KK
20522008-04-11 Kaz Kojima <kkojima@gcc.gnu.org>
2053
2054 * configure.ac: (need_64bit_hwint): Need 64bit hwint for sh-*-*
2055 and shbe-*-*.
2056 * configure: Rebuilt.
2057
93d45d9e
JM
20582008-04-02 Joseph Myers <joseph@codesourcery.com>
2059
2060 * include/cpplib.h (struct cpp_callbacks): Add used_define,
2061 used_undef and before_define.
2062 (NODE_USED): Define.
2063 * directives.c (do_define, do_undef, undefine_macros, do_ifdef,
2064 do_ifndef, cpp_pop_definition): Handle new flag and use new
2065 callbacks.
2066 * expr.c (parse_defined): Handle new flag and use new callbacks.
2067 * macro.c (enter_macro_context, _cpp_free_definition): Handle new
2068 flag and use new callbacks.
2069
d4c32e1d
JJ
20702008-04-01 Jakub Jelinek <jakub@redhat.com>
2071
2072 PR pch/13675
2073 * files.c (struct _cpp_file): Remove pch field.
2074 (pch_open_file): Don't set file->pch, just file->pchname.
2075 (should_stack_file): After pfile->cb.read_pch call
2076 free pchname and clear pchname, don't close file->fd.
2077 Test file->pchname instead of file->pch. Don't close fd after cb.
2078 (_cpp_stack_include): Test file->pchname instead of file->pch.
2079
161031e3
TT
20802008-03-28 Tom Tromey <tromey@redhat.com>
2081
2082 * Makefile.in (POSTCOMPILE): New variable.
2083 (.c.o): Use it.
2084
14ccf800
TT
20852008-03-13 Tom Tromey <tromey@redhat.com>
2086
2087 PR libcpp/35322:
2088 * directives.c (destringize_and_run): Set pfile->directive.
2089
830465c6
MM
20902008-03-06 Markus Milleder <markus.milleder@generali.at>
2091
2092 PR preprocessor/35458
2093 * mkdeps.c (munge): Quote '#' with a '\'.
2094
d482a073
RW
20952008-02-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2096
2097 PR preprocessor/35379
2098 * mkdeps.c (deps_write): Ensure the first target always appears
2099 in the first column, without leading backslash newline. Avoid
2100 some more extra whitespace.
2101
185a6cc1
TS
21022008-02-25 Thiemo Seufer <ths@mips.com>
2103
d482a073 2104 * Makefile.in ($(srcdir)/config.in): Depend on configure.ac.
185a6cc1 2105
2bf41bf0
TT
21062008-02-19 Tom Tromey <tromey@redhat.com>
2107
2108 * traditional.c (lex_identifier): Use CPP_HASHNODE.
2109 * lex.c (lex_identifier): Use CPP_HASHNODE.
2110 * include/line-map.h (LINEMAP_POSITION_FOR_COLUMN): Wrap in
2111 do-while.
2112 * identifiers.c (alloc_node): Change return type.
2113 (_cpp_init_hashtable): Don't cast 'alloc_node'.
2114 (proxy_assertion_broken): New declaration.
2115 (cpp_forall_identifiers): Move comment.
2116 * line-map.c (linemap_add): Comment fix.
2117 (linemap_line_start): Indentation fix.
2118
765d600a
JJ
21192008-01-25 Jakub Jelinek <jakub@redhat.com>
2120
2121 PR preprocessor/34692
2122 * macro.c (collect_args): Add pragma_buff argument. Push
2123 CPP_PRAGMA ... CPP_PRAGMA_EOL tokens to *pragma_buff, rather
2124 than into arguments. Reset prevent_expansion and parsing_args
2125 state at CPP_PRAGMA_EOL/CPP_EOF.
2126 (funlike_invocation_p): Add pragma_buff argument, pass it through
2127 to collect_args.
2128 (enter_macro_context): Add result argument. Adjust
2129 funlike_invocation_p caller. Emit all deferred pragma tokens
2130 gathered during collect_args before the expansion, add a padding
2131 token. Return 2 instead of 1 if any pragma tokens were prepended.
2132 (cpp_get_token): If enter_macro_context returns 2, don't return
2133 a padding token, instead cycle to grab CPP_PRAGMA token.
2134 * directives.c (_cpp_handle_directive): If was_parsing_args
2135 in deferred pragma, leave parsing_args and prevent_expansion as is.
2136
ec46053b
TT
21372008-01-22 Tom Tromey <tromey@redhat.com>
2138
765d600a 2139 PR c++/34859
ec46053b
TT
2140 * macro.c (_cpp_create_definition): Handle __STDC_LIMIT_MACROS and
2141 __STDC_CONSTANT_MACROS.
2142
681c6ab0
FF
21432008-01-07 Fred Fish <fnf@specifix.com>
2144
765d600a 2145 PR preprocessor/30363
681c6ab0
FF
2146 * traditional.c (replace_args_and_push): Add local variable
2147 cxtquote, calculate the replacement text size assuming a
2148 worst case of every input character quoted with backslash,
2149 and properly handle output quoting of quote characters in
2150 actual arguments used in function-like macros.
2151
33ae4837
TT
21522008-01-03 Tom Tromey <tromey@redhat.com>
2153
765d600a 2154 PR preprocessor/34602
33ae4837
TT
2155 * directives.c (do_line): Don't try to spell EOF token.
2156 (do_linemarker): Add comment.
2157
675575f5
DD
21582007-12-11 DJ Delorie <dj@redhat.com>
2159
2160 * charset.c (convert_using_iconv): Close out any shift states,
2161 returning to the initial state.
2162
97f6bd40
TT
21632007-12-06 Tom Tromey <tromey@redhat.com>
2164
765d600a 2165 PR c/29172
97f6bd40
TT
2166 * internal.h (struct cpp_reader) <file_hash_entries>: Changed
2167 type.
2168 <file_hash_entries_allocated, file_hash_entries_used>: Removed.
2169 * files.c (FILE_HASH_POOL_SIZE): New macro.
2170 (struct file_hash_entry_pool): New.
2171 (destroy_all_cpp_files): New function.
2172 (allocate_file_hash_entries): Allocate a file_hash_entry_pool.
2173 (new_file_hash_entry): Update.
2174 (free_file_hash_entries): New function.
2175 (_cpp_cleanup_files): Call free_file_hash_entries and
2176 destroy_all_cpp_files.
2177 (cpp_clear_file_cache): New function.
2178 * include/cpplib.h (cpp_clear_file_cache): Declare.
2179
d56a25e1
TT
21802007-12-03 Tom Tromey <tromey@redhat.com>
2181
765d600a 2182 PR preprocessor/34288
d56a25e1
TT
2183 * configure.ac, config.in: Rebuilt.
2184 * configure.ac: Check for ssize_t.
2185
607f74e9
TT
21862007-11-30 Tom Tromey <tromey@redhat.com>
2187
765d600a 2188 PR preprocessor/32868
607f74e9
TT
2189 * macro.c (_cpp_create_definition): Special case
2190 __STDC_FORMAT_MACROS.
2191
b0f4807f
MM
21922007-11-16 Michael Matz <matz@suse.de>
2193
2194 * files.c (search_path_head): Fix check for absolute paths.
2195
f1e20710
TT
21962007-11-11 Tom Tromey <tromey@redhat.com>
2197
765d600a 2198 PR c++/17557
f1e20710
TT
2199 * include/cpplib.h (cpp_included_before): Declare.
2200 * files.c (struct file_hash_entry) <location>: New field.
2201 (_cpp_find_file): Initialize new field.
2202 (make_cpp_dir): Likewise.
2203 (cpp_included_before): New function.
2204
f373b44d
TT
22052007-11-01 Tom Tromey <tromey@redhat.com>
2206
765d600a 2207 PR preprocessor/30805
f373b44d
TT
2208 * macro.c (paste_tokens): Handle padding token.
2209 (paste_tokens): Don't abort unless padding has PASTE_LEFT flag.
2210
5b9a40df
TT
22112007-10-31 Tom Tromey <tromey@redhat.com>
2212
765d600a 2213 PR preprocessor/30786
5b9a40df
TT
2214 * macro.c (builtin_macro): Return result of _cpp_do__Pragma.
2215 * directives.c (_cpp_do__Pragma): Return error status.
2216 * internal.h (_cpp_do__Pragma): Update.
2217 * directives.c (get__Pragma_string): Back up if EOF seen.
2218
5ffeb913
TT
22192007-09-06 Tom Tromey <tromey@redhat.com>
2220
2221 * internal.h (struct cpp_reader) <invocation_location>: New
2222 field.
2223 (struct cpp_reader) <set_invocation_location>: Likewise.
2224 * init.c (cpp_set_line_map): New function.
2225 * line-map.c (linemap_add): Use linemap's allocator.
2226 * include/line-map.h (GTY): Define.
2227 (line_map_realloc): New typedef.
2228 (struct line_map): Mark with GTY.
2229 (struct line_maps): Likewise.
2230 (struct line_maps) <maps>: Likewise.
2231 (struct line_maps) <reallocator>: New field.
2232 * include/symtab.h (GTY): Conditionally define.
2233 * include/cpplib.h (cpp_set_line_map): Declare.
2234 (cpp_get_token_with_location): Declare.
2235 * macro.c (cpp_get_token): Set invocation_location on the reader.
2236 (cpp_get_token_with_location): New function.
2237
ac6b1c67
CF
22382007-08-30 Chao-ying Fu <fu@mips.com>
2239
2240 * expr.c (interpret_float_suffix): Support hr, r, lr, llr, uhr, ur,
2241 ulr, ullr, hk, k, lk, llk, uhk, uk, ulk, ullk.
2242 (cpp_classify_number): Support decimal fixed-point constants without
2243 exponents.
2244 Warn about fixed-point constants when -pedantic.
2245 * include/cpplib.h (CPP_N_SMALL, CPP_N_MEDIUM, CPP_N_LARGE): Change
2246 comments to support fixed-point values.
2247 (CPP_N_FRACT, CPP_N_ACCUM): Define.
2248
cda5e672
TT
22492007-08-18 Tom Tromey <tromey@redhat.com>
2250
765d600a 2251 PR preprocessor/32974
cda5e672
TT
2252 * directives.c (parse_include): Don't check for EOL when
2253 processing #pragma dependency.
2254
ccfc4c91
OW
22552007-07-30 Ollie Wild <aaw@google.com>
2256
2257 * directives-only.c: New file.
2258 * internal.h (struct _cpp_dir_only_callbacks): New.
2259 (_cpp_preprocess_dir_only): New function.
2260 * directives.c (_cpp_handle_directive): Check directives_only before
2261 disabling execution of indented directives.
2262 * files.c (_cpp_stack_file): Add directives_only check.
2263 * include/cpplib.h (struct cpp_options): Add directives_only.
2264 (cpp_init_special_builtins): New function.
2265 * init.c (cpp_init_special_builtins): New function.
2266 (cpp_init_builtins): Move builtin_array initialization to
2267 cpp_init_special_builtins.
2268 (post_options): Check directives_only before setting
2269 pfile->state.prevent_expansion = 1.
2270 * macro.c (_cpp_builtin_macro_text): Print an error if __COUNTER__
2271 is expanded inside a directive while -fdirectives-only is enabled.
2272 * Makefile.in (libcpp_a_OBJS): Add directives-only.o.
2273 (libcpp_a_SOURCES): Add directives-only.c.
2274
a206413a
UB
22752007-07-04 Uros Bizjak <ubizjak@gmail.com>
2276
2277 * traditional.c (_cpp_scan_out_logical_line): Initialize
2278 fmacro.args, fmacro.node, fmacro.offset, fmacro.line and
2279 fmacro.args to prevent 'may be used uninitialized' warning.
2280
c77cd3d1
UB
22812007-07-03 Uros Bizjak <ubizjak@gmail.com>
2282
2283 * include/cpplib.h (CPP_N_WIDTH_MD, CPP_N_MD_W, CPP_N_MD_Q):
2284 Add new constants.
2285 * expr.c (interpret_float_suffix): Process 'w', 'W', 'q' and 'Q'
2286 suffixes. Return CPP_N_MD_W for 'w' or 'W' suffixes and CPP_N_MD_Q
2287 for 'q' or 'Q' suffixes.
2288
66938a1d
DS
22892007-06-17 Danny Smith <dannysmith@users.sourceforge.net
2290
e1311401 2291 * files.c (open_file): Correct typo.
66938a1d 2292
71995ede
VP
22932007-06-16 Vladimir Prus <vladimir@codesourcery.com>
2294
e1311401 2295 * files.c (open_file): Prevent the call
71995ede
VP
2296 for stat from overwriting errno.
2297
84152c25
VP
22982007-06-09 Vladimir Prus <vladimir@codesourcery.com>
2299
e1311401 2300 * files.c (open_file): Account for the
84152c25
VP
2301 fact that on windows, opening a directory gives
2302 EACCES.
2303
f7fd775f
JW
23042007-06-05 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
2305
2306 PR preprocessor/23479
2307 * expr.c (cpp_classify_number): Implement 0b-prefixed binary
2308 integer constants.
2309 (append_digit): Likewise.
2310 * include/cpplib.h: Add CPP_N_BINARY, to be used for 0b-prefixed
2311 binary integer constants.
2312
ed0e74e0
DK
23132007-05-31 Dave Korn <dave.korn@artimi.com>
2314
2315 PR preprocessor/14331
2316 * lex.c (_cpp_get_fresh_line): Don't warn if no newline at EOF.
2317
a702045a
OW
23182007-05-24 Ollie Wild <aaw@google.com>
2319
2320 * macro.c (_cpp_builtin_macro_text): Handle BT_COUNTER.
2321 * pch.c (cpp_write_pch_deps): Save __COUNTER__ state.
2322 (cpp_write_pch_state): Save __COUNTER__ state.
2323 (cpp_valid_state): Check valid __COUNTER__ state.
2324 (cpp_read_state): Read new __COUNTER__ state.
2325 * include/cpplib.h (enum builtin_type): Add BT_COUNTER enumerator.
2326 * init.c (builtin_array): Add __COUNTER__/BT_COUNTER.
2327 * internal.h (struct cpp_reader): Add counter member.
2328
126e073b
SM
23292007-05-23 Simon Martin <simartin@users.sourceforge.net>
2330
2331 PR preprocessor/20077
2332 * macro.c (create_iso_definition): Fixed the method to determine
2333 whether the token-pasting operator appears at the beginning or the end
2334 of a macro.
2335
0b4cafec
ILT
23362007-05-21 Ian Lance Taylor <iant@google.com>
2337
2338 * internal.h (struct cpp_reader): Add new fields:
2339 nonexistent_file_hash and nonexistent_file_ob.
2340 * files.c: Include "obstack.h".
2341 (find_file_in_dir): Before trying to open the file, look up the
2342 path name in the hash table of nonexistent files. After failing
2343 to open the file, add the path name to the hash table.
2344 (_cpp_find_file): Cache the results of looking up the file name
2345 starting with the quote and bracket chain heads, if we can.
2346 (nonexistent_file_hash_eq): New static function.
2347 (_cpp_init_files): Initialize pfile->nonexistent_file_hash and
2348 pfile->nonexistent_file_ob.
2349 (_cpp_cleanup_files): Free pfile->nonexistent_file_hash and
2350 pfile->nonexistent_file_ob.
2351
30e04921
JJ
23522007-05-14 Janis Johnson <janis187@us.ibm.com>
2353
5a6bb57e
JJ
2354 * expr.c (cpp_classify_number): Warn about dfp constant for -pedantic.
2355
30e04921
JJ
2356 PR c/31924
2357 * expr.c (interpret_float_suffix): Check for invalid suffix.
2358
22a8a52d
EC
23592007-05-02 Eric Christopher <echristo@apple.com>
2360
2361 * expr.c (num_div_op): Don't overflow if the result is
2362 zero.
2363
fca35e1b
TT
23642007-05-02 Tom Tromey <tromey@redhat.com>
2365
765d600a 2366 PR preprocessor/28709
fca35e1b
TT
2367 * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs.
2368
4cd97075
MM
23692007-03-30 Michael Meissner <michael.meissner@amd.com>
2370
2371 * directives.c (lex_macro_node_from_str): Fix alloca call to be
2372 type correct.
2373
121de39f
RH
23742007-03-30 Richard Henderson <rth@redhat.com>
2375
2376 * directives.c (lex_macro_node_from_str): New.
2377 (cpp_push_definition, cpp_pop_definition): New.
2378 * include/cpplib.h (cpp_push_definition, cpp_pop_definition): Declare.
2379
4fcb360b
BM
23802007-03-01 Brooks Moses <brooks.moses@codesourcery.com>
2381
2382 * Makefile.in: Add dummy install-pdf target.
2383
67e64439
TT
23842007-01-30 Tom Tromey <tromey@redhat.com>
2385
765d600a 2386 PR preprocessor/30468
67e64439
TT
2387 * mkdeps.c (apply_vpath): Strip successive '/'s if we stripped
2388 './'.
2389
ee380365
TT
23902007-01-30 Tom Tromey <tromey@redhat.com>
2391
765d600a 2392 PR preprocessor/29966
ee380365
TT
2393 * macro.c (lex_expansion_token): Save and restore cpp_reader's
2394 cur_token.
2395 (_cpp_create_definition): Don't restore cur_token here.
2396 * lex.c (_cpp_lex_token): Added assertion.
2397
024abeb3
TT
23982007-01-27 Tom Tromey <tromey@redhat.com>
2399
2400 * configure: Rebuilt.
2401
ee1c2a10
TT
24022007-01-12 Tom Tromey <tromey@redhat.com>
2403
765d600a 2404 PR preprocessor/28227
ee1c2a10
TT
2405 * directives.c (lex_macro_node): Added 'is_def_or_undef'
2406 argument.
2407 (do_define): Update.
2408 (do_undef): Update.
2409 (do_ifdef): Update.
2410 (do_ifndef): Update.
2411
67214c16
PB
24122007-01-11 Paolo Bonzini <bonzini@gnu.org>
2413
2414 * configure: Regenerate.
2415
1aa6ca40
PB
24162007-01-11 Paolo Bonzini <bonzini@gnu.org>
2417
2418 * configure: Regenerate.
2419
705e2d28
TT
24202007-01-04 Tom Tromey <tromey@redhat.com>
2421
765d600a 2422 PR preprocessor/28165
705e2d28
TT
2423 * internal.h (cpp_in_primary_file): New function.
2424 * directives.c (do_include_next): Use cpp_in_primary_file.
2425 (do_pragma_once): Likewise.
2426 (do_pragma_system_header): Likewise.
2427
7af45bd4
ILT
24282006-12-29 Ian Lance Taylor <iant@google.com>
2429
2430 * lex.c (_cpp_clean_line): Add uses of __builtin_expect. Don't
2431 look backward at the end of the line unless we saw a backslash.
2432
9d30f270
JJ
24332006-12-29 Jakub Jelinek <jakub@redhat.com>
2434
2435 PR preprocessor/29612
2436 * directives.c (do_linemarker): Set pfile->buffer->sysp always, not
2437 only when new_sysp is non-zero.
2438
30b0edc0
TT
24392006-12-28 Tom Tromey <tromey@redhat.com>
2440
765d600a 2441 PR preprocessor/30001
30b0edc0
TT
2442 * charset.c (_cpp_convert_input): Check that to.len is greater
2443 than zero.
2444
85d9c13c
TS
24452006-11-20 Trevor Smigiel <Trevor_Smigiel@playstation.sony.com>
2446
2447 * configure.ac (need_64bit_hwint): Need 64bit hwint for SPU.
83cc06b2 2448 * configure: Rebuilt.
85d9c13c 2449
dfafdaa6
DG
24502006-11-01 Douglas Gregor <doug.gregor@gmail.com>
2451
2452 * include/cpplib.h (enum c_lang): Add CLK_GNUCXX0X and CLK_CXX0X
2453 for experimental C++0x mode.
2454 * init.c (lang_defaults): Add defaults for C++0x modes. C++0x has
2455 adopted the preprocessor changes introduced in C99.
2456
0f45f0f5
JM
24572006-10-29 Joseph Myers <joseph@codesourcery.com>
2458
2459 * configure.ac (need_64bit_hwint): Set for i[34567]86-*-linux*
2460 depending on --enable-targets=all.
2461 * configure: Regenerate.
2462
de000d22
JJ
24632006-10-12 Jakub Jelinek <jakub@redhat.com>
2464
2465 PR preprocessor/28709
2466 * macro.c (paste_tokens): Do error reporting here, use BUF with the
2467 spelled LHS token as opposed to spelling it again.
2468 (paste_all_tokens): Don't report errors here, just break on failure.
2469
b5422ad7
BM
24702006-10-10 Brooks Moses <bmoses@stanford.edu>
2471
2472 * Makefile.in: Added empty "pdf" target.
2473
aaf50ff2
GK
24742006-09-22 Geoffrey Keating <geoffk@apple.com>
2475
2476 * configure.ac: Make need_64_bit_hwint case for x86-darwin
2477 match exactly the glob in gcc/config.gcc.
2478 * configure: Regenerate.
2479
c663e301
JM
24802006-09-13 Joseph S. Myers <joseph@codesourcery.com>
2481
2482 PR c/28768
2483 PR preprocessor/14634
2484 * lex.c (lex_string): Pedwarn for unterminated literals.
2485
f7288899
EC
24862006-09-08 Eric Christopher <echristo@apple.com>
2487
2488 * configure.ac: Add 64-bit HWI support for i?86-darwin.
2489
b52dbbf8
SE
24902006-08-14 Steve Ellcey <sje@cup.hp.com>
2491
2492 PR c++/28288
2493 PR c++/14556
2494 * include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
2495 (CPP_LAST_EQ): Change.
2496 (CPP_LAST_PUNCTUATOR): Change.
2497 * expr.c (cpp_operator): Remove MIN and MAX.
2498 (reduce): Remove CPP_MIN and CPP_MAX.
2499 (num_binary_op): Ditto.
2500 * lex.c (_cpp_lex_direct): Ditto.
2501 (cpp_avoid_paste): Remove ? as legal symbol after > or <.
2502
1c90c6f9
JJ
25032006-06-09 Jakub Jelinek <jakub@redhat.com>
2504
2505 PR preprocessor/27746
2506 * directives.c (do_pragma): Handle pragma with valid namespace
2507 and invalid name coming from macro expansion.
2508 * directives.c (destringize_and_run): Initialize next field in
2509 context.
2510
2511 PR c/27747
2512 PR c++/27748
2513 * directives.c (destringize_and_run): Set NO_EXPAND on the
2514 tokens.
2515
2516 * macro.c (_cpp_backup_tokens): Fix comment typo.
2517
5c3c3683
DJ
25182006-05-31 Daniel Jacobowitz <dan@codesourcery.com>
2519
2520 * Makefile.in (CATALOGS): Add po/ prefix.
2521 * configure: Regenerated.
2522
b2bd74bc
CD
25232006-05-23 Carlos O'Donell <carlos@codesourcery.com>
2524
2525 * Makefile.in: Add install-html target. Add install-html to .PHONY
2526
be8ac3e2
GZ
25272006-02-17 Grigory Zagorodnev <grigory_zagorodnev@linux.intel.com>
2528
2529 * macro.c (_cpp_builtin_macro_text): Handle BT_TIMESTAMP.
2530 * files.c (_cpp_get_file_stat): New function.
2531 * include/cpplib.h (builtin_type): Add BT_TIMESTAMP.
2532 * init.c (builtin_array): Add support for __TIMESTAMP__/BT_TIMESTAMP.
2533 * internal.h (_cpp_get_file_stat): Prototype.
2534 (struct cpp_buffer): Add timestamp.
2535
83900997
JJ
25362006-01-23 Jakub Jelinek <jakub@redhat.com>
2537
2538 PR preprocessor/25717
2539 * init.c (cpp_init_builtins): If __STDC__ will not change value
2540 between system headers and other sources, define it as a normal
2541 macro rather than a builtin.
2542 * macro.c (_cpp_builtin_macro_text) <case BT_STDC>: Only check
2543 cpp_in_system_header condition.
2544
25452006-01-05 Paolo Bonzini <bonzini@gnu.org>
9220c30c
PB
2546
2547 * Makefile.in: Use -MMD instead of -MD.
2548
bc4071dd
RH
25492006-01-04 Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
2550 Richard Henderson <rth@redhat.com>
2551
2552 Merge from gomp branch:
2553 * directives.c (struct pragma_entry): Add is_deferred. Add ident
2554 entry to value union.
2555 (end_directive): Don't eat the line if in_deferred_pragma.
2556 (run_directive): Remove pragma hacks.
2557 (insert_pragma_entry): Remove.
2558 (new_pragma_entry): New.
2559 (register_pragma_1): Split out of register_pragma. Only handle
2560 the lookup tree and return the new entry.
2561 (cpp_register_pragma): Fill in the pragma entry here.
2562 (cpp_register_deferred_pragma): New.
2563 (register_pragma_internal): New.
2564 (_cpp_init_internal_pragmas): Use register_pragma_internal.
2565 (do_pragma): Allow pragma expansion after namespace. For deferred
2566 pragmas, don't slurp the line into a string.
2567 (destringize_and_run): Save tokens for deferred pragmas.
2568 (cpp_handle_deferred_pragma): Remove.
2569 * macro.c (builtin_macro): Remove pragma token hack.
2570 (_cpp_push_token_context): Rename from push_token_context and export.
2571 * internal.h (struct lexer_state): Add pragma_allow_expansion.
2572 (_cpp_push_token_context): Declare.
2573 * lex.c (_cpp_lex_token): Allow _cpp_handle_directive to return
2574 a token. Update the line number correctly if so.
2575 (_cpp_lex_direct): Emit CPP_PRAGMA_EOL tokens.
2576 (cpp_token_val_index): Return CPP_TOKEN_FLD_PRAGMA for pragmas.
2577 * include/cpplib.h (PRAGMA_EOL): New.
2578 (CPP_TOKEN_FLD_PRAGMA): New.
2579 (struct cpp_token): Add val.pragma.
2580 (struct cpp_options): Remove defer_pragmas.
2581 (cpp_handle_deferred_pragma): Remove.
2582 (cpp_register_deferred_pragma): Declare.
2583
d09e893f
JJ
25842006-01-01 Jakub Jelinek <jakub@redhat.com>
2585
2586 PR c++/25294
2587 * directives.c (do_pragma): If pragma line ends with multi-line
2588 block comment, end the saved deferred pragma string before that
2589 comment. Handle embedded '\0' chars on the pragma line.
2590
ab84748a
VR
25912005-12-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
2592
2593 PR c++/23333
2594 * include/cpplib.h: Add PURE_ZERO to flags for the cpp_token structure.
2595
ad6ed77e
JG
25962005-12-07 Jon Grimm <jgrimm2@us.ibm.com>
2597 Ben Elliston <bje@au.ibm.com>
2598
2599 * include/cpplib.h (CPP_N_DFLOAT): New.
2600 * expr.c (interpret_float_suffix): Identify df, dd, and dl
2601 suffixes as decimal floating point constants.
2602 (cpp_classify_number): Disallow hexadecimal DFP constants.
2603
ba096620 26042005-11-14 Gerald Pfeifer <gerald@pfeifer.com>
bc4071dd 2605 Ian Lance Taylor <ian@airs.com>
ba096620
GP
2606
2607 * include/cpplib.h (struct cpp_callbacks): Annotate error with
2608 ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
2609
456b8ce5
UB
26102005-11-09 Per Bothner <per@bothner.com>
2611 Uros Bizjak <uros@kss-loka.si>
f7288899 2612
456b8ce5
UB
2613 PR c/24101
2614 * init.c (read_original_filename): Temporarily set
2615 state.in_directive before calling _cpp_lex_direct for
2616 CPP_HASH tokens.
2617
5571f74f
JW
26182005-11-03 James E Wilson <wilson@specifix.com>
2619
2620 PR preprocessor/24202
2621 * files.c (_cpp_pop_file_buffer): Set buffer_valid to false.
2622
a63607ed
JM
26232005-11-04 Joseph S. Myers <joseph@codesourcery.com>
2624
2625 * include/cpplib.h (struct cpp_callbacks): Make error take
2626 va_list* parameter.
2627 * errors.c (cpp_error): Update call to callback.
2628
651ed942
AP
26292005-11-03 Andrew Pinski <pinskia@physics.uc.edu>
2630
2631 PR preprocessor/22042
2632 * macro.c (_cpp_builtin_macro_text): Lower the needed max
2633 buffer size.
2634 (cpp_quote_string): Don't octalify non printable
2635 charactors.
2636
178b58b5
JM
26372005-11-03 Joseph S. Myers <joseph@codesourcery.com>
2638
2639 PR c++/17964
2640 * include/cpplib.h (struct cpp_options): Add client_diagnostic.
2641 (struct cpp_callbacks): Add error.
2642 * errors.c (cpp_error): If client_diagnostic, use error callback.
2643 * charset.c (convert_escape): Don't use %03o in diagnostic.
2644
3ee5ed11 26452005-10-21 James E Wilson <wilson@specifix.com>
6568f34b
JW
2646
2647 PR preprocessor/15220
2648 * files.c (_cpp_find_file): New parameter angle_brackets. Fix all
2649 callers. Pass to open_file_failed.
2650 (open_file_failed): New parameter angle_brackets. Fix all callers.
2651 Use in print_dep assignment.
2652 * init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
2653 * internal.h (_cpp_find_file): Add new parm to declaration.
f7288899 2654
077fc835
KH
26552005-10-08 Kazu Hirata <kazu@codesourcery.com>
2656
2657 * configure.ac: Require 64-bit int for arm*-*-*eabi*.
2658 * configure: Regenerate.
2659
cbc43ae0
ILT
26602005-10-04 Ian Lance Taylor <ian@airs.com>
2661
2662 PR preprocessor/13726
2663 * directives.c (check_eol_return_comments): New static function.
2664 (parse_include): Add buf parameter. Change all callers.
2665 (do_include_common): If not discard comments, turn on
2666 save_comments. Pass collected comments to include callback.
2667 * include/cpplib.h (struct cpp_callbacks): Add new parameter to
2668 include callback: cpp_token list.
2669
af15a2fe
JM
26702005-09-20 Joseph S. Myers <joseph@codesourcery.com>
2671
2672 * include/cpplib.h (struct cpp_options): Add extended_identifiers.
2673 * init.c (struct lang_flags, lang_defaults): Add
2674 extended_identifiers.
2675 (cpp_set_lang): Use it.
2676 * lex.c (forms_identifier_p): Check extended_identifiers.
2677
f5eab47e
JJ
26782005-08-30 Jakub Jelinek <jakub@redhat.com>
2679
2680 PR preprocessor/20348
2681 PR preprocessor/20356
2682 * files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
2683 2004-06-05 changes.
2684
467129e6
KG
26852005-07-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2686
2687 * configure.ac (ACX_PROG_CC_WARNING_OPTS): add
2688 -Wmissing-format-attribute.
2689
2690 * configure: Regenerate.
2691
200031d1
KC
26922005-06-29 Kelley Cook <kcook@gcc.gnu.org>
2693
2694 * all files: Update FSF address in copyright headers.
2695 * makeucnid.c (write_copyright): Update outputted FSF address.
2696
f610dd5f
ZW
26972005-06-13 Zack Weinberg <zack@codesourcery.com>
2698
2699 * configure.ac: Invoke ZW_CREATE_DEPDIR and
2700 ZW_PROG_COMPILER_DEPENDENCIES.
2701 * aclocal.m4, configure: Regenerate.
2702 * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
2703 New variables.
2704 (distclean): Clean up $(DEPDIR) and its contents.
2705 (.c.o): Use $(COMPILE).
2706 Include $(DEPDIR)/*.Po for most object->header dependencies.
2707
c3f829c1
GDR
27082005-05-28 Gabriel Dos Reis <gdr@integrable-solutions.net>
2709
2710 * configure.ac: Check declarations for asprintf and vasprintf.
2711 * config.in: Regenerate.
2712 * configure: Likewise.
2713
2714 * charset.c (conversion_loop): Use XRESIZEVEC.
2715 (convert_no_conversion): Likewise.
2716 (convert_using_iconv): Likewise.
2717 (init_iconv_desc): Cast return value of alloca.
2718 (cpp_host_to_exec_charset): Use XNEWVEC.
2719 (emit_numeric_escape): Use XRESIZEVEC.
2720 (cpp_interpret_string): Use XNEWVEC.
2721 (cpp_interpret_string): Use XRESIZEVEC.
2722 (_cpp_interpret_identifier): Cast return value of alloca.
2723 (_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
2724 * directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
2725 (parse_include): Use XNEWVEC.
2726 (insert_pragma_entry): Rename local variable "new" to
f610dd5f 2727 "new_entry".
c3f829c1
GDR
2728 (save_registered_pragmas): Cast return value of xmemdup.
2729 (destringize_and_run): Same for alloca.
2730 (parse_assertion): Likewise.
2731 (do_assert): Cast allocated storage to proper type.
2732 (cpp_define): Likewise.
2733 (_cpp_define_builtin): Likewise.
2734 (cpp_undef): Likewise.
2735 (handle_assertion): Likewise.
2736 (cpp_push_buffer): Rename local variable "new" to "new_buffer".
2737 * expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
2738 (CPP_UMINUS): Likewise.
2739 (struct cpp_operator): Rename from struct operator.
2740 (_cpp_expand_op_stack): Use XRESIZEVEC.
2741 * files.c (pch_open_file): Use XNEWVEC.
2742 (pch_open_file): Use XRESIZEVEC.
2743 (read_file_guts): Use XNEWVEC and XRESIZEVEC.
2744 (dir_name_of_file): Use XNEWVEC.
2745 (make_cpp_file): Use XCNEW.
2746 (make_cpp_dir): Likewise.
2747 (allocate_file_hash_entries): USE XNEWVEC.
2748 (cpp_included): Cast return value of htab_find_with_hash.
2749 (append_file_to_dir): Use XNEWVEC.
2750 (read_filename_string): Likewise. Use XRESIZEVEC too.
2751 (read_name_map): Cast return value of alloca. Use XRESIZEVEC.
2752 (remap_filename): Use XNEWVEC.
2753 (struct pchf_entry): Move definition out of struct pchf_data.
2754 (_cpp_save_file_entries): Use XCNEWVAR.
2755 (_cpp_read_file_entries): Use XNEWVAR.
2756 * identifiers.c (alloc_node): Use XOBNEW.
2757 * init.c (cpp_create_reader): Use XCNEW.
2758 (cpp_init_builtins): Cast of b->value to enum builtin_type.
2759 (read_original_directory): Cast return value of alloca.
2760 * lex.c (add_line_note): Use XRESIZEVEC.
2761 (warn_about_normalization): Use XNEWVEC.
2762 (_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
2763 (new_buff): Use XNEWVEC.
2764 * line-map.c (linemap_add): Use XRESIZEVEC.
2765 * macro.c (builtin_macro): Cast return value of alloca.
2766 (paste_tokens): Likewise.
2767 (expand_arg): Use XNEWVEC and XRESIZEVEC.
2768 (_cpp_save_parameter): Use XRESIZEVEC.
2769 (create_iso_definition): Cast allocated storage to proper type.
2770 (_cpp_create_definition): Likewise.
2771 (cpp_macro_definition): Use XRESIZEVEC.
2772 * makedepend.c (add_clm): Use XNEW.
2773 (add_dir): Likewise.
2774 * mkdeps.c (munge): Use XNEWVEC.
2775 (deps_init): Use XCNEW.
2776 (deps_add_target): Use XRESIZEVEC.
2777 (deps_add_default_target): Cast return value of alloca.
2778 (deps_add_dep): Use XRESIZEVEC.
2779 (deps_add_vpath): Likewise. Use XNEWVEC too.
2780 (deps_restore): Likewise.
2781 * pch.c (save_idents): Use XNEW and XNEWVEC.
2782 (cpp_save_state): Use XNEW.
2783 (count_defs): Cast return value of htab_find.
2784 (write_defs): Likewise.
2785 (cpp_write_pch_deps): Use XNEWVEC.
2786 (collect_ht_nodes): Use XRESIZEVEC.
2787 (cpp_valid_state): Use XNEWVEC.
2788 (save_macros): Use XRESIZEVEC. Cast return value of xmemdup.
2789 * symtab.c (ht_create): Use XCNEW.
2790 (ht_lookup_with_hash): Cast return value of obstack_copy0.
2791 (ht_expand): Use XCNEWVEC.
2792 * system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
2793 (bool): Do not define if __cplusplus.
2794
1ed17cd5
ZW
27952005-05-12 Zack Weinberg <zack@codesourcery.com>
2796
2797 * directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
2798 (do_sccs): Delete function definition, #define to do_ident.
2799 (do_ident): Don't hardwire directive name.
2800
5a8c20ce
RK
28012005-05-12 Ryota Kunisawa <kunisawa@access.co.jp>
2802
2803 PR bootstrap/21230
2804 * configure: Regenerate.
2805
473c5bc9
AP
28062005-04-27 Andris Pavenis <pavenis@latnet.lv>
2807
2808 * files.c: Include io.h for DJGPP to get prototype of setmode.
2809
c1fc5047
PB
28102005-04-19 Per Bothner <per@bothner.com>
2811
2812 PR preprocessor/20907
2813 * line-map.c (linemap_line_start): Fix bug when we need to increse
2814 column_bits but can re-use the current line_map.
2815
042630ad
KG
28162005-04-19 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2817
2818 * system.h (fopen, fdopen, freopen): Define these to the unlocked
2819 libiberty functions.
2820
0d667716
KG
28212005-04-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
2822
2823 * configure.ac (libcpp_UNLOCKED_FUNCS): New.
2824 (AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
2825 * system.h (putchar, getc, getchar, clearerr, feof, fileno,
2826 fflush, fgetc, fgets, ferror, fread): Redefine to the associated
2827 _unlocked function.
2828 (fwrite_unlocked): Fix prototype.
1ed17cd5 2829
0d667716
KG
2830 * configure, config.in: Regenerate.
2831
cae064e7
JJ
28322005-04-05 Jakub Jelinek <jakub@redhat.com>
2833
2834 PR preprocessor/19475
2835 * macro.c (create_iso_definition): For < ISO C99, don't
2836 pedwarn if there is no whitespace between macro name and its
2837 replacement, but the replacement starts with a basic character
2838 set character.
2839
cbada204
AJ
28402005-03-28 Andreas Jaeger <aj@suse.de>
2841
2842 * lex.c (warn_about_normalization): Cast field width to int to
2843 avoid warning.
2844
f42eccdb
JM
28452005-03-19 Joseph S. Myers <joseph@codesourcery.com>
2846
2847 * configure.ac: Consistently use solaris2.1[0-9]* instead of
2848 solaris2.1[0-9].
2849 * configure: Regenerate.
2850
c79e602b
GK
28512005-03-15 Geoffrey Keating <geoffk@apple.com>
2852
2853 * charset.c (_cpp_valid_ucn): In identifiers, reject a partial
2854 UCN rather than printing an error.
2855
50668cf6
GK
28562005-03-14 Geoffrey Keating <geoffk@apple.com>
2857
6baba9bb
GK
2858 * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
2859
28602005-03-14 Geoffrey Keating <geoffk@apple.com>
1ed17cd5 2861
50668cf6
GK
2862 * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
2863 * charset.c: Update for new format of ucnid.h.
2864 (ucn_valid_in_identifier): Update for new format of ucnid.h.
2865 Add NST parameter, and update it; update callers.
2866 (cpp_valid_ucn): Add NST parameter, update callers. Replace abort
2867 with cpp_error.
2868 (convert_ucn): Pass normalize_state to cpp_valid_ucn.
2869 * internal.h (struct normalize_state): New.
2870 (INITIAL_NORMALIZE_STATE): New.
2871 (NORMALIZE_STATE_RESULT): New.
2872 (NORMALIZE_STATE_UPDATE_IDNUM): New.
2873 (_cpp_valid_ucn): New.
2874 * lex.c (warn_about_normalization): New.
2875 (forms_identifier_p): Add normalize_state parameter, update callers.
2876 (lex_identifier): Add normalize_state parameter, update callers. Keep
2877 the state current.
2878 (lex_number): Likewise.
2879 (_cpp_lex_direct): Pass normalize_state to subroutines. Check
2880 it with warn_about_normalization.
2881 * makeucnid.c: New.
2882 * ucnid.h: Replace.
2883 * ucnid.pl: Remove.
2884 * ucnid.tab: Make appropriate for input to makeucnid.c. Remove
2885 comments about obsolete version of C++.
2886 * include/cpplib.h (enum cpp_normalize_level): New.
2887 (struct cpp_options): Add warn_normalize field.
2888
47e20491
GK
28892005-03-11 Geoffrey Keating <geoffk@apple.com>
2890
2891 * directives.c (glue_header_name): Update call to cpp_spell_token.
2892 * internal.h (_cpp_interpret_identifier): New.
2893 * charset.c (_cpp_interpret_identifier): New.
2894 (_cpp_valid_ucn): Allow UCN version of '$'.
2895 * lex.c (lex_identifier): Add extra parameter to indicate if initial
2896 character was '$' or '\'. Support identifiers with UCNs.
2897 (forms_identifier_p): Allow UCNs.
2898 (_cpp_lex_direct): Pass extra parameter to lex_identifier.
2899 (utf8_to_ucn): New.
2900 (cpp_spell_token): Add FORSTRING parameter. Use it.
2901 (cpp_token_as_text): Update call to cpp_spell_token.
2902 (cpp_output_token): Write UCNs back out.
2903 (stringify_arg): Update call to cpp_spell_token.
2904 (paste_tokens): Likewise.
2905 (cpp_macro_definition): Likewise.
2906 * macro.c (stringify_arg): Likewise.
2907 (paste_tokens): Likewise.
2908 (cpp_macro_definition): Likewise.
2909 * include/cpplib.h: Add parameter to cpp_spell_token.
2910
73096711
JJ
29112005-03-04 Jakub Jelinek <jakub@redhat.com>
2912
2913 PR bootstrap/20282
2914 PR bootstrap/20305
2915 * macro.c (replace_args, cpp_get_token): Copy whole
2916 cpp_token_u instead of just cpp_string field from it.
2917
2203a881
DP
29182005-02-28 Devang Patel <dpatel@apple.com>
2919
2920 * directives.c (do_line): Save sysp early before line table is
2921 realloc'ed.
1ed17cd5 2922
c5ff069d
ZW
29232005-02-20 Zack Weinberg <zack@codesourcery.com>
2924
2925 PR 18785
2926 * charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
2927 (cpp_host_to_exec_charset): New function.
2928 * include/cpplib.h: Declare cpp_host_to_exec_charset.
2929
04c90eea
DP
29302005-02-19 Devang Patel <dpatel@apple.com>
2931
2932 * charset.c (_cpp_convert_input): Check '\r' before inserting
2933 '\n' at the end.
c5ff069d 2934
6da55c00
EC
29352005-02-15 Eric Christopher <echristo@redhat.com>
2936
2937 PR preprocessor/19077
2938 * macro.c (cpp_macro_definition): Move handling of whitespace
2939 to PREV_WHITE conditional. Remove overloading of len
2940 variable.
2941
31c3e631
KH
29422005-02-14 Kazu Hirata <kazu@cs.umass.edu>
2943
2944 * directives.c, files.c, init.c, internal.h, macro.c, pch.c,
2945 traditional.c: Update copyright.
2946
be0f1e54
PB
29472005-02-14 Paolo Bonzini <bonzini@gnu.org>
2948
2949 PR bootstrap/19818
2950 * configure.ac: Check for declaration of basename and getopt.
2951 * config.in: Regenerate.
2952 * configure: Regenerate.
2953 * internal.h (ustrcspn): New.
2954 * macro.c (create_iso_definition): Fix allocation of memory.
2955 (padding_token): Add cast to remove const-ness.
2956 * pch.c (cpp_read_state): Use ustrcspn.
2957
ecddfb39
MS
29582005-02-08 Mike Stump <mrs@apple.com>
2959
2960 * files.c (pchf_adder): Remove.
2961 (struct pchf_adder_info): Likewise.
2962 (_cpp_save_file_entries): Write out all files so that #import works.
2963
9fcdd891
JM
29642005-01-23 Joseph S. Myers <joseph@codesourcery.com>
2965
2966 * configure: Regenerate.
2967
ecfd72e7
TS
29682005-01-11 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
2969
2970 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
2971
6c25a4f7 2972 * include/cpplib.h: Also update copyright years.
c5ff069d 2973
942926ad
GK
29742005-01-03 Geoffrey Keating <geoffk@apple.com>
2975
2976 * files.c (_cpp_find_file): Add files found by search_path_exhausted
2977 to the list of all files.
2978
a2566ae9
GDR
29792005-01-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
2980
2981 * internal.h: Update references to Cpp lib filenames.
2982 * directives.c: Likewise.
2983 * init.c: Likewise.
2984 * macro.c: Likewise.
2985 * traditional.c: Likewise.
2986
1b449375
EB
29872004-12-15 Eric Botcazou <ebotcazou@libertysurf.fr>
2988
2989 PR preprocessor/15167
2990 * files.c (destroy_cpp_file): New function.
2991 (should_stack_file): Make a new file if the
2992 compared file is still stacked.
2993
28303828
NN
29942004-11-28 Nathanael Nerode <neroden@gcc.gnu.org>
2995
c5ff069d 2996 PR preprocessor/17610
28303828
NN
2997 * directives.c (do_include_common): Error out if an empty filename
2998 is given for #include (or #include_next or #import).
2999
c812785a
RS
30002004-11-27 Roger Sayle <roger@eyesopen.com>
3001 Zack Weinberg <zack@codesourcery.com>
3002
3003 * internal.h: Replace all uses of uchar with unsigned char.
3004 * include/cpp-id-data.h: Likewise. Guard typedef of uchar
3005 with !IN_GCC, so uchar is only defined whilst building libcpp.
3006
f91eaa01
KC
30072004-11-24 Kelley Cook <kcook@gcc.gnu.org>
3008
3009 * aclocal.m4: Regenerate.
3010
f78ce0c2
RS
30112004-11-24 Roger Sayle <roger@eyesopen.com>
3012
3013 PR preprocessor/15824
3014 * configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
3015 directly, instead of the non-existant "system.h" and "ansidecl.h".
3016 * configure: Regenerate.
3017
b5b3e36a 30182004-11-23 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 3019 Joseph Myers <joseph@codesourcery.com>
b5b3e36a
DJ
3020
3021 * internal.h (struct lexer_state): Add in_deferred_pragma.
3022 * directives.c (struct pragma_entry): Add allow_expansion.
3023 (insert_pragma_entry): Take allow_expansion flag.
3024 (register_pragma): Likewise.
3025 (cpp_register_pragma): Likewise.
3026 (_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
3027 (do_pragma): Honor allow_expansion.
3028 (cpp_handle_deferred_pragma): Set in_deferred_pragma.
3029 * include/cpplib.h (cpp_register_pragma): Update prototype.
3030
a8e68029 30312004-11-18 Daniel Jacobowitz <dan@codesourcery.com>
c5ff069d 3032 Mark Mitchell <mark@codesourcery.com>
a8e68029
DJ
3033
3034 * configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
3035 need_64bit_hwint=yes.
3036 * configure: Regenerate.
3037
50f47ee0
JM
30382004-11-09 Joseph S. Myers <joseph@codesourcery.com>
3039
3040 * Makefile.in ($(PACKAGE).pot): New rule. Depend on
3041 po/$(PACKAGE).pot.
3042 (po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
3043 arguments. Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
3044 Remove local srcdir path from generated file.
3045
968e08d6 30462004-11-04 Zack Weinberg <zack@codesourcery.com>
c5ff069d 3047 Gerald Pfeifer <gerald@pfeifer.com>
968e08d6
ZW
3048
3049 * internal.h (HAVE_ICONV): Undefine if we do not have HAVE_ICONV_H
3050 as well.
3051
3da3d587
ZW
30522004-10-27 Zack Weinberg <zack@codesourcery.com>
3053
3054 PR 18075
3055 * directives.c (do_pragma): Do not defer pragmas which are unknown.
3056 (cpp_handle_deferred_pragma): Add cast to silence warning.
3057
ac24fc25
JM
30582004-10-14 Joseph S. Myers <jsm@polyomino.org.uk>
3059
3060 * errors.c (_cpp_begin_message): Print "error: " for errors.
3061
7731405b
AJ
30622004-10-10 Andreas Jaeger <aj@suse.de>
3063
3064 * makedepend.c: Include mkdeps.h for prototype of deps_add_vpath.
3065 * Makefile.in (makedepend.o): Add dependency on mkdeps.h.
3066
646544e3
AP
30672004-10-08 Andrew Pinski <pinskia@physics.uc.edu>
3068
3069 * pch.c (cpp_write_pch_state): Remove variable z as it is not
3070 used.
3071 (cpp_read_state): Remove unused variables, m, d and mac_count.
3072
67a74146
PB
30732004-09-29 Per Bothner <per@bothner.com>
3074
3075 * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
3076 cb.line_change. Otherwise do_pragma will call the line_change
3077 call-back with a meaningless line number.
3078
018a4785
ZW
30792004-09-24 Zack Weinberg <zack@codesourcery.com>
3080
3081 * configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
3082 programs cluster. Use ACX_PROG_CC_WARNING_OPTS,
3083 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC, ACX_PROG_CC_WARNINGS_ARE_ERRORS.
3084 * aclocal.m4, configure: Regenerate.
3085 * init.c: Include localedir.h.
3086 * Makefile.in (WARN_CFLAGS, ALL_CFLAGS): New variables.
3087 (DEFS): Delete.
3088 (.c.o): Use $(ALL_CFLAGS).
3089 (localedir.h, localedir.hs): New rules.
3090 (clean): Use rm -rf to remove directories.
3091 (distclean): Also delete localedir.h and localedir.hs.
3092 (init.o): Update dependencies.
3093
88fa57d7
KC
30942004-09-22 Kelley Cook <kcook@gcc.gnu.org>
3095
3096 * Makefile.in (aclocal.m4): Update dependencies.
3097 * configure.ac (AC_CONFIG_MACRO_DIR): New.
3098 * aclocal.m4, configure: Regenerate.
3099
8f8e9aa5
ZW
31002004-09-17 Zack Weinberg <zack@codesourcery.com>
3101
a29f62d9
ZW
3102 * charset.c (_cpp_destroy_iconv, emit_numeric_escape)
3103 (_cpp_convert_input, _cpp_default_encoding): Add comments.
3104 Some other comments in this file also tweaked.
3105
8f8e9aa5
ZW
3106 * directives.c (do_pragma): Save current buffer position
3107 before lexing the pragma keywords; don't call
3108 _cpp_backup_tokens in the defer_pragmas case.
3109
a2981930
PB
31102004-09-15 Per Bothner <per@bothner.com>
3111
3112 * include/line-map.h (line_map_start): Add parameter names so
3113 preceding comment makes sense.
3114 (linemap_add): Remove from comment mention of non-existing parameter.
3115
21b11495
ZW
31162004-09-09 Matt Austern <austern@apple.com>
3117 Zack Weinberg <zack@codesourcery.com>
3118
3119 * include/cpplib.h (TTYPE_TABLE): Remove CPP_ and SPELL_
3120 prefixes throughout. Add entry for PRAGMA. Remove
3121 unnecessary "= 0" from EQ.
3122 (enum cpp_ttype): Adjust OP and TK definitions to restore
3123 prefixes, via token-paste.
3124 (CPP_LAST_EQ, CPP_FIRST_DIGRAPH, CPP_LAST_PUNCTUATOR, CPP_LAST_CPP_OP):
3125 Change from #defines to additional cpp_ttype enumerators.
3126 (struct cpp_options): Add defer_pragmas.
3127 (cpp_handle_deferred_pragma): Prototype new interface.
3128
3129 * internal.h (struct cpp_reader): Add directive_result.
3130 * directives.c (struct pragma_entry): Add is_internal field;
3131 give boolean fields type bool.
3132 (start_directive): Initialize pfile->directive_result.type.
3133 (_cpp_do__Pragma): Likewise.
3134 (run_directive): Do not crash if pfile->buffer->prev is NULL.
3135 (insert_pragma_entry): Add 'internal' argument; set new->is_internal
3136 from it.
3137 (register_pragma): New static function, bulk of former
3138 cpp_register_pragma here; add 'internal' argument, pass along
3139 to insert_pragma_entry.
3140 (cpp_register_pragma): Now a wrapper around register_pragma which
3141 always passes false for 'internal' argument.
3142 (_cpp_init_internal_pragmas): Call register_pragma directly, passing
3143 true for 'internal'.
3144 (do_pragma): If CPP_OPTION (pfile, defer_pragmas) and this isn't
3145 an internal pragma, save text till the end of the line as a CPP_PRAGMA
3146 token instead of executing the pragma.
3147 (cpp_handle_deferred_pragma): New interface.
3148 * lex.c (token_spellings): Adjust OP and TK definitions to
3149 match changes to cpplib.h.
3150 (_cpp_lex_token): Check for a directive-result token and
3151 return it if present.
3152 (cpp_token_val_index): Handle CPP_PRAGMA.
3153 * macro.c (cpp_builtin_macro_text): Correct comment.
3154 (builtin_macro): Handle directive-result tokens from _cpp_do__Pragma.
3155
0fd9e8dd
SB
31562004-09-06 Serge Belyshev <belyshev@lubercy.com>
3157
3158 PR preprocessor/14699
3159 * symtab.c (ht_dump_statistics): Change type of sum_of_squares
3160 from size_t to double.
3161
39b8ce7f
AS
31622004-08-28 Andreas Schwab <schwab@suse.de>
3163 Andreas Jaeger <aj@suse.de>
3164
3165 * configure.ac: Set PACKAGE correctly.
3166 * configure: Regenerated.
3167
5d1f4b27
PB
31682004-08-25 Paolo Bonzini <bonzini@gnu.org>
3169
3170 * Makefile.in: Add back top_builddir.
3171
078e3ffe
PB
31722004-08-25 Paolo Bonzini <bonzini@gnu.org>
3173
3174 * configure.ac: Replace Automake macro invocations
3175 with manual Autoconf checks and substitutions.
3176 * configure: Regenerate.
3177 * aclocal.m4: Regenerate.
3178 * config.in: Regenerate.
3179 * Makefile.am: Removed.
3180 * Makefile.in: Heavy simplification and reorganization.
3181
b3f8d95d
MM
31822004-08-09 Mark Mitchell <mark@codesourcery.com>
3183
3184 * configure.ac (arm*-*-eabi*): New target.
3185 (arm*-*-symbianelf*): Likewise.
3186 * configure: Regenerated.
3187
72bb2c39
BI
31882004-07-24 Bernardo Innocenti <bernie@develer.com>
3189
3190 * internal.h (xnew, xcnew, xnewvec, xcnewvec, xobnew): Remove.
3191 * directives.c: Use XNEW-family macros from libiberty.
3192 * lex.c: Likewise.
3193 * macro.c: Likewise.
3194 * cpplib.h (cpp_deps_style): Export enum with name.
3195
21b11495 31962004-07-23 Matthias Klose <doko@debian.org>
72bb2c39 3197
21b11495 3198 * init.c (init_library): Use PACKAGE for the text domain.
85eac2a0 3199
a23ee064
AP
32002004-07-16 Andris Pavenis <pavenis@latnet.lv>
3201
3202 PR preprocessor/16366
3203 * internal.h (struct cpp_reader): New field dir_hash.
3204 * files.c (make_cpp_dir): Use dir_hash, not file_hash.
3205 (_cpp_init_files, _cpp_cleanup_files): Update for new field.
3206
a09d4744
NB
32072004-07-04 Neil Booth <neil@duron.akihabara.co.uk>
3208
3209 PR preprocessor/16192
3210 PR preprocessor/15913
3211 PR preprocessor/15572
3212 * expr.c (_cpp_parse_expr): Handle remaining cases where an
3213 expression is missing.
3214 * init.c (post_options): Traditional cpp doesn't do // comments.
3215
f58f7def
PB
32162004-06-30 Per Bothner <per@bothner.com>
3217
3218 * include/line-map.h (fileline): Remove old typedef.
3219 * internal.h (struct cpp_reader): Use source_location typedef instead.
3220
e83d8d43
ZW
32212004-06-26 Zack Weinberg <zack@codesourcery.com>
3222
3223 Partially revert patch of 2004-06-05.
3224 * files.c (search_cache): Remove pfile argument. Don't check
3225 for file that would be found by "" or <> search here...
3226 (_cpp_find_file): ...do it here, before calling find_file_in_dir.
3227 Do not apply directory-of-current-file correction to files
3228 found by this check. Rearrange code slightly.
3229
c0d578e6
GK
32302004-06-21 Geoffrey Keating <geoffk@apple.com>
3231
3232 * files.c (should_stack_file): Correct swapped parameters to call
3233 to cb.read_pch.
3234 * pch.c (cpp_valid_state): Handle -fpreprocessed.
3235
159d5224
PB
32362004-06-15 Paolo Bonzini <bonzini@gnu.org>
3237
3238 * Makefile.in: Regenerate with automake 1.8.5.
3239 * aclocal.m4: Likewise.
3240 * configure: Regenerate.
3241
2fac9c01
ZW
32422004-06-11 Zack Weinberg <zack@codesourcery.com>
3243
3244 * configure.ac: Don't invoke ACX_HEADER_STDBOOL.
3245 * configure, config.in: Regenerate.
3246 * system.h: Unconditionally define bool as unsigned char,
3247 BOOL_BITFIELD as unsigned int.
3248 * .cvsignore: New file.
3249
d8044160
GK
32502004-06-09 Geoffrey Keating <geoffk@apple.com>
3251
3252 * traditional.c (push_replacement_text): Set macro->traditional.
3253 (save_replacement_text): Likewise.
3254 * pch.c (cpp_write_pch_state): Don't write list of defined macros.
3255 (struct save_macro_item): Delete.
3256 (struct save_macro_data): Use a character array not the previous
3257 structured format.
3258 (save_macros): Save macro as text not as internal structures.
3259 (cpp_prepare_state): Update for changes to save_macro_data.
3260 (cpp_read_state): Don't read macros defined in PCH. Restore
2cf22451 3261 -D macros as text.
d8044160
GK
3262 * macro.c (create_iso_definition): Honour alloc_subobject.
3263 Clear traditional flag.
3264 (_cpp_create_definition): Honour alloc_subobject.
3265 * lex.c (cpp_token_val_index): New.
3266 * internal.h: Include cpp-id-data.h.
3267 (uchar): Move definition to cpp-id-data.h.
3268 (U): Likewise.
3269 (cpp_macro): Likewise.
3270 * directives.c (struct answer): Move to cpp-id-data.h.
3271 (do_assert): Honour alloc_subobject.
2cf22451
ZW
3272
3273 * include/symtab.h (struct ht): Add field 'alloc_subobject'.
3274 * include/cpplib.h (struct cpp_string): Add GTY marker.
3275 (enum cpp_token_fld_kind): New.
3276 (struct cpp_token): Add GTY markers.
3277 (cpp_token_val_index): Prototype.
3278 (CPP_HASHNODE_VALUE_IDX): New.
3279 (struct cpp_hashnode): Don't skip fields of 'value' when marking.
3280 * include/cpp-id-data.h: New file.
d8044160 3281
0ca8e815
PB
32822004-06-09 Paolo Bonzini <bonzini@gnu.org>
3283
3284 * Makefile.am (all-local): New.
3285 * Makefile.in: Regenerate.
3286
b51fa00f
RS
32872004-06-06 Roger Sayle <roger@eyesopen.com>
3288
3289 * Makefile.am (LIBICONV): Declare.
3290 (makedepend_LDADD): Use LIBICONV.
3291 * Makefile.in: Regenerate.
3292
5e2f3f39
AP
32932004-06-05 Andrew Pinski <pinskia@physics.uc.edu>
3294
3295 * Makefile.am (LIBINTL): Declare
3296 (makedepend_LDADD): Use LIBINTL.
3297 * Makefile.in: Regenerate.
3298
c6e83800
ZW
32992004-06-05 Zack Weinberg <zack@codesourcery.com>
3300
3301 * Makefile.am: Add makedepend.
3302 * Makefile.in, aclocal.m4: Regenerate.
3303 * charset.c: Insert a space to avoid a warning.
3304 * directives.c: Include mkdeps.h.
3305 (_cpp_handle_directive): Reenable macro expander if appropriate.
3306 (undefine_macros): Inline body of _cpp_free_definition for speed.
3307 Do not call undef callback or _cpp_warn_if_unused_macro.
3308 (cpp_get_deps): New interface.
3309 * files.c (search_cache): Add pfile argument. Check for file
3310 that would be found by "" or <> search here...
3311 (_cpp_find_file): ...not here. Correct recorded start_dir of
3312 files found by directory-of-current-file search that would be
3313 found by "" or <> search.
3314 * init.c (cpp_add_dependency_target): Delete.
3315 * internal.h (struct lexer_state): Add discarding_output flag.
3316 * lex.c (lex_identifier): Compute hash function while scanning.
3317 * macro.c (cpp_scan_nooutput): Disable macro expansion outside
3318 directives.
3319 * makedepend.c: New file.
3320 * mkdeps.c (struct deps): Add vpath vector.
3321 (apply_vpath, deps_add_vpath): New function.
3322 (deps_free): Free vpath vector.
3323 (deps_add_dep, deps_add_target): Use apply_vpath.
3324 * symtab.c (calc_hash): Use HT_HASHSTEP and HT_FINISH.
3325 (ht_lookup_with_hash): New function.
3326 * cpplib.h, mkdeps.h: Update prototypes.
3327 * symtab.h: Update prototypes.
3328 (HT_HASHSTEP, HT_FINISH): New macros.
3329
b453c95f
GK
33302004-05-29 Geoffrey Keating <geoffk@apple.com>
3331
3332 * symtab.c (ht_create): Set entries_owned.
3333 (ht_destroy): Honour entries_owned.
3334 (ht_expand): Likewise.
3335 (ht_load): New.
2cf22451
ZW
3336 * include/symtab.h (struct ht): New field 'entries_owned'
3337 (ht_load): New prototype.
b453c95f 3338
963e23c5
PB
33392004-05-26 Paolo Bonzini <bonzini@gnu.org>
3340
3341 PR bootstrap/15651
3342 * configure.ac: Fix m4 quoting when picking
3343 the size of HOST_WIDE_INT.
3344 * configure: Regenerate.
3345
0429bc77
PB
33462004-05-25 Paolo Bonzini <bonzini@gnu.org>
3347
3348 * Makefile.am: the correct directory for
3349 gettext include files is given by @INCINTL@.
3350 * Makefile.in: Regenerate.
3351
c86dd7db
PB
33522004-05-24 Paolo Bonzini <bonzini@gnu.org>
3353
3354 * system.h [!ENABLE_NLS]: dgettext takes two
3355 parameters.
3356
4f4e53dd
PB
33572004-05-23 Paolo Bonzini <bonzini@gnu.org>
3358
3359 Moved libcpp from the gcc subdirectory to the toplevel.
3360 * Makefile.am: New file.
3361 * Makefile.in: Regenerate.
3362 * configure.ac: New file.
3363 * configure: Regenerate.
3364 * config.in: Regenerate.
3365 * charset.c: Moved from gcc/cppcharset.c. Add note about
3366 brokenness of input charset detection. Adjust for change
3367 in name of cppucnid.h.
3368 * errors.c: Moved from gcc/cpperror.c. Do not include intl.h.
3369 * expr.c: Moved from gcc/cppexp.c.
3370 * files.c: Moved from gcc/cppfiles.c. Do not include intl.h.
3371 Remove #define of O_BINARY, it is in system.h.
3372 * identifiers.c: Moved from gcc/cpphash.c.
3373 * internal.h: Moved from gcc/cpphash.h. Change header
3374 guard name. All other files adjusted to match name change.
3375 * init.c: Moved from gcc/cppinit.c.
3376 (init_library) [ENABLE_NLS]: Call bindtextdomain.
3377 * lex.c: Moved from gcc/cpplex.c.
3378 * directives.c: Moved from gcc/cpplib.c.
3379 * macro.c: Moved from gcc/cppmacro.c.
3380 * pch.c: Moved from gcc/cpppch.c. Do not include intl.h.
3381 * traditional.c: Moved from gcc/cpptrad.c.
3382 * ucnid.h: Moved from gcc/cppucnid.h. Change header
3383 guard name.
3384 * ucnid.pl: Moved from gcc/cppucnid.pl.
3385 * ucnid.tab: Moved from gcc/cppucnid.tab. Change header
3386 guard name.
3387 * symtab.c: Moved from gcc/hashtable.c.
3388 * line-map.c: Moved from gcc. Do not include intl.h.
3389 * mkdeps.c: Moved from gcc.
3390 * system.h: New file.
2cf22451
ZW
3391 * include/cpplib.h: Moved from gcc. Change header guard name.
3392 * include/line-map.h: Moved from gcc. Change header guard name.
3393 * include/mkdeps.h: Moved from gcc. Change header guard name.
3394 * include/symtab.h: Moved from gcc/hashtable.h. Change header
3395 guard name.