Commit Graph

87 Commits

Author SHA1 Message Date
Gerald Pfeifer ba0966205a cpplib.h (struct cpp_callbacks): Annotate error with ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).
* include/cpplib.h (struct cpp_callbacks): Annotate error with
	ATTRIBUTE_FPTR_PRINTF(3,0) instead of ATTRIBUTE_PRINTF(3,0).

Co-Authored-By: Ian Lance Taylor <ian@airs.com>

From-SVN: r106891
2005-11-14 16:28:55 +00:00
Uros Bizjak 456b8ce5db re PR c/24101 (Segfault with preprocessed source)
libcpp/

	PR c/24101
	* init.c (read_original_filename): Temporarily set
	state.in_directive before calling _cpp_lex_direct for
	CPP_HASH tokens.

gcc/

	PR c/24101
	* toplev.c (process_options): Initialize debug_hooks early
	in case lang_hooks.post_options ends up calling a debug_hook.

gcc/testsuite/

	PR c/24101
	* gcc.dg/pr24101-1.i, gcc.dg/pr24101-2.i: New tests.
	* gcc.dg/dg.exp: Run main loop also for *.i files.

From-SVN: r106677
2005-11-09 07:30:03 +01:00
James E Wilson 5571f74f66 Fix failure with pragma once where buffer is NULL and buffer_valid is true.
PR preprocessor/24202
* files.c (_cpp_pop_file_buffer): Set buffer_valid to false.

From-SVN: r106472
2005-11-03 18:10:19 -08:00
Joseph Myers a63607ed43 cp-tree.h (cp_cpp_error), [...]): Take va_list* parameter.
gcc/cp:
	* cp-tree.h (cp_cpp_error), error.c (cp_cpp_error): Take va_list*
	parameter.

libcpp:
	* include/cpplib.h (struct cpp_callbacks): Make error take
	va_list* parameter.
	* errors.c (cpp_error): Update call to callback.

From-SVN: r106466
2005-11-04 01:16:32 +00:00
Andrew Pinski 651ed94280 re PR preprocessor/22042 (stringification BUG)
2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR preprocessor/22042
        * macro.c (_cpp_builtin_macro_text): Lower the needed max
        buffer size.
        (cpp_quote_string): Don't octalify non printable
        charactors.
2005-11-03  Andrew Pinski  <pinskia@physics.uc.edu>

        PR preprocessor/22042
        * gcc.dg/cpp/strify4.c: New test.

From-SVN: r106463
2005-11-03 16:23:01 -08:00
Joseph Myers 178b58b59e re PR c++/17964 (cpp error messages contain wrong line in C++)
gcc:
	PR c++/17964
	* diagnostic.c (diagnostic_set_info_translated): New function.
	(diagnostic_set_info): Use it.  Add comment.
	* diagnostic.h (diagnostic_set_info_translated): Declare.

gcc/cp:
	* error.c (cp_cpp_error): New function.
	* cp-tree.h (cp_cpp_error): Declare.
	* parser.c (cp_lexer_new_main): Set CPP option client_diagnostic
	and error callback after lexing.

gcc/testsuite:
	* g++.dg/cpp/string-1.C: New test.

libcpp:
	* include/cpplib.h (struct cpp_options): Add client_diagnostic.
	(struct cpp_callbacks): Add error.
	* errors.c (cpp_error): If client_diagnostic, use error callback.
	* charset.c (convert_escape): Don't use %03o in diagnostic.

From-SVN: r106454
2005-11-03 23:08:18 +00:00
Jim Wilson 3ee5ed116d Fix date of last ChangeLog entry.
From-SVN: r105760
2005-10-21 10:59:07 -07:00
James E Wilson 6568f34b01 Fix bug with -MM -MG.
PR preprocessor/15220
* files.c (_cpp_find_file): New parameter angle_brackets.  Fix all
callers.  Pass to open_file_failed.
(open_file_failed): New parameter angle_brackets.  Fix all callers.
Use in print_dep assignment.
* init.c (cpp_read_main_file): Pass additional arg to _cpp_find_file.
* internal.h (_cpp_find_file): Add new parm to declaration.

From-SVN: r105757
2005-10-21 10:54:20 -07:00
Kazu Hirata 077fc835e5 configure.in (arm-*-linux-gnueabi): Add to noconfigdirs target-libffi...
/
	* configure.in (arm-*-linux-gnueabi): Add to noconfigdirs
	target-libffi, target-qthreads, target-libjava, and
	targetlibobjc.
	* configure: Regenerate.

gcc/
	Merge from csl-arm-branch:
	2005-09-07  Paul Brook  <paul@codesourcery.com>
	* config/arm/linux-eabi.h (SUBTARGET_EXTRA_LINK_SPEC): Prepend a
	space to string.

	2005-04-30  Paul Brook  <paul@codesourcery.com>
	* config/arm/bpabi.h (TARGET_DEFAULT): Define.
	* config/arm/linux-eabi.h (SUBTARGET_CPU_DEFAULT): Define.

	2005-03-07  Daniel Jacobowitz  <dan@codesourcery.com>
	* config/arm/arm.c (arm_all_abis): Add aapcs-linux.
	(arm_override_options): Use TARGET_AAPCS_BASED.
	* config/arm/arm.h (enum arm_abi_type): Add ARM_ABI_AAPCS_LINUX.
	(PTRDIFF_TYPE): Use int for AAPCS.
	(DEFAULT_SHORT_ENUMS): Use false for aapcs-linux.
	* config/arm/linux-eabi.h (ARM_DEFAULT_ABI, WCHAR_TYPE): Define.
	(DEFAULT_SHORT_ENUMS): Delete.
	* doc/invoke.texi (ARM Options): Document -mabi=aapcs-linux.

	2004-12-15  Daniel Jacobowitz  <dan@codesourcery.com>
	* config/arm/arm.h (DEFAULT_SHORT_ENUMS): Wrap in #ifndef.
	* config/arm/linux-eabi.h (DEFAULT_SHORT_ENUMS): Define to 0.
	* config/arm/t-linux-eabi (TARGET_LIBGCC2_CFLAGS): Set to -fPIC.

	2004-12-03  Mark Mitchell  <mark@codesourcery.com>
	* config/arm/linux-eabi.h (LIBGCC_SPEC): Do not define.

	2004-11-22  Mark Mitchell  <mark@codesourcery.com>
	* config.gcc (arm*-*-linux-gnueabi): Use __cxa_atexit.

	2004-11-19  Mark Mitchell  <mark@codesourcery.com>
	* config.gcc (arm*-*-linux-gnueabi): Add it.
	* config/arm/bpabi.h (FPUTYPE_DEFAULT): Undefine it before
	redefining it.
	(TARGET_OS_CPP_BUILTINS): Likeiwse.
	* config/arm/linux-eabi.h: New file.
	* config/arm/linux-elf.h (LINUX_TARGET_INTERPRETER): New macro.
	(LINUX_TARET_LINK_SPEC): Likewise.
	(LINK_SPEC): Use it.
	* config/arm/t-linux-eabi: New file.

libcpp/
	* configure.ac: Require 64-bit int for arm*-*-*eabi*.
	* configure: Regenerate.

libstdc++/
	Merge from csl-arm-branch:
	2004-12-15  Daniel Jacobowitz  <dan@codesourcery.com>
	* libstdc++-v3/config/linker-map.gnu: Add ARM EABI symbols.

From-SVN: r105121
2005-10-08 18:17:20 +00:00
Ian Lance Taylor cbc43ae091 re PR preprocessor/13726 (cpp -C -dI loses comments on same line as #include directives)
libcpp/
	PR preprocessor/13726
	* directives.c (check_eol_return_comments): New static function.
	(parse_include): Add buf parameter.  Change all callers.
	(do_include_common): If not discard comments, turn on
	save_comments.  Pass collected comments to include callback.
	* include/cpplib.h (struct cpp_callbacks): Add new parameter to
	include callback: cpp_token list.
gcc/
	PR preprocessor/13726
	* c-ppoutput.c (cb_include): Add comments parameter, and print out
	any comments passed in.
gcc/testsuite/
	PR preprocessor/13726
	* gcc.dg/cpp/cmdlne-dI-C.c: New test.
	* gcc.dg/cpp/cmdlne-dI-C.h: New file.

From-SVN: r104951
2005-10-04 18:06:19 +00:00
Joseph Myers af15a2fed7 c.opt (fextended-identifiers): New.
gcc:
	* c.opt (fextended-identifiers): New.
	* c-opts.c (c_common_handle_option): Handle
	-fextended-identifiers.
	* doc/cpp.texi: Update documentation of extended identifiers.
	* doc/cppopts.texi (-fextended-identifiers): Document.

gcc/testsuite:
	* g++.dg/cpp/ucnid-1.C, g++.dg/cpp/normalize-1.C,
	g++.dg/other/ucnid-1.C, gcc.dg/cpp/normalize-1.c,
	gcc.dg/cpp/normalize-2.c, gcc.dg/cpp/normalize-3.c,
	gcc.dg/cpp/normalize-4.c, gcc.dg/cpp/ucnid-1.c,
	gcc.dg/cpp/ucnid-2.c, gcc.dg/cpp/ucnid-3.c, gcc.dg/cpp/ucnid-4.c,
	gcc.dg/cpp/ucnid-5.c, gcc.dg/cpp/ucnid-7.c,gcc.dg/ucnid-1.c,
	gcc.dg/ucnid-2.c, gcc.dg/ucnid-3.c, gcc.dg/ucnid-4.c,
	gcc.dg/ucnid-5.c, gcc.dg/ucnid-6.c: Add -fextended-identifiers.
	* gcc.dg/cpp/ucnid-8.c: New test.

libcpp:
	* include/cpplib.h (struct cpp_options): Add extended_identifiers.
	* init.c (struct lang_flags, lang_defaults): Add
	extended_identifiers.
	(cpp_set_lang): Use it.
	* lex.c (forms_identifier_p): Check extended_identifiers.

From-SVN: r104462
2005-09-20 21:31:37 +01:00
Jakub Jelinek f5eab47e10 re PR preprocessor/20348 (File not included when file with same name is included before)
PR preprocessor/20348
	PR preprocessor/20356
	* files.c (_cpp_find_file, search_cache): Revert 2004-06-26 and
	2004-06-05 changes.

	* gcc.dg/cpp/pr20348.c: New test.
	* gcc.dg/cpp/pr20348.h: New file.
	* gcc.dg/cpp/inc/pr20348.h: New file.
	* gcc.dg/cpp/inc/pr20348-aux.h: New file.
	* gcc.dg/cpp/pr20356.c: New test.
	* gcc.dg/cpp/pr20356.h: New file.
	* gcc.dg/cpp/inc/pr20356.h: New file.
	* gcc.dg/cpp/inc/pr20356-aux.h: New file.

From-SVN: r103629
2005-08-30 08:28:21 +02:00
Kaveh R. Ghazi 467129e657 configure.ac (ACX_PROG_CC_WARNING_OPTS): add -Wmissing-format-attribute.
* configure.ac (ACX_PROG_CC_WARNING_OPTS): add
	-Wmissing-format-attribute.

	* configure: Regenerate.

From-SVN: r102327
2005-07-24 03:44:26 +00:00
Kelley Cook 200031d1d5 all files: Update FSF address in copyright headers.
2005-06-29  Kelley Cook  <kcook@gcc.gnu.org>

	* all files: Update FSF address in copyright headers.
	* makeucnid.c (write_copyright): Update outputted FSF address.

From-SVN: r101413
2005-06-29 02:34:39 +00:00
Zack Weinberg f610dd5f4c top level:
* depcomp: Update from automake CVS.  Add 'ia64hp' stanza.
	In 'cpp' stanza, support '#line' as well as '# '.
config:
	* depstand.m4, lead-dot.m4: New files.
libcpp:
	* configure.ac: Invoke ZW_CREATE_DEPDIR and
	ZW_PROG_COMPILER_DEPENDENCIES.
	* aclocal.m4, configure: Regenerate.
	* Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.base, COMPILE):
	New variables.
	(distclean): Clean up $(DEPDIR) and its contents.
	(.c.o): Use $(COMPILE).
	Include $(DEPDIR)/*.Po for most object->header dependencies.

From-SVN: r100874
2005-06-13 08:26:05 +00:00
Gabriel Dos Reis c3f829c1a6 configure.ac: Check declarations for asprintf and vasprintf.
* configure.ac: Check declarations for asprintf and vasprintf.
	* config.in: Regenerate.
	* configure: Likewise.

	* charset.c (conversion_loop): Use XRESIZEVEC.
	(convert_no_conversion): Likewise.
	(convert_using_iconv): Likewise.
	(init_iconv_desc): Cast return value of alloca.
	(cpp_host_to_exec_charset): Use XNEWVEC.
	(emit_numeric_escape): Use XRESIZEVEC.
	(cpp_interpret_string): Use XNEWVEC.
	(cpp_interpret_string): Use XRESIZEVEC.
	(_cpp_interpret_identifier): Cast return value of alloca.
	(_cpp_convert_input): Use XNEWVEC and XRESIZEVEC.
	* directives.c (glue_header_name): Use XNEWVEC and XRESIZEVEC.
	(parse_include): Use XNEWVEC.
	(insert_pragma_entry): Rename local variable "new" to
	"new_entry".
	(save_registered_pragmas): Cast return value of xmemdup.
	(destringize_and_run): Same for alloca.
	(parse_assertion): Likewise.
	(do_assert): Cast allocated storage to proper type.
	(cpp_define): Likewise.
	(_cpp_define_builtin): Likewise.
	(cpp_undef): Likewise.
	(handle_assertion): Likewise.
	(cpp_push_buffer): Rename local variable "new" to "new_buffer".
	* expr.c (CPP_UPLUS): Cast value to type cpp_ttype.
	(CPP_UMINUS): Likewise.
	(struct cpp_operator): Rename from struct operator.
	(_cpp_expand_op_stack): Use XRESIZEVEC.
	* files.c (pch_open_file): Use XNEWVEC.
	(pch_open_file): Use XRESIZEVEC.
	(read_file_guts): Use XNEWVEC and XRESIZEVEC.
	(dir_name_of_file): Use XNEWVEC.
	(make_cpp_file): Use XCNEW.
	(make_cpp_dir): Likewise.
	(allocate_file_hash_entries): USE XNEWVEC.
	(cpp_included): Cast return value of htab_find_with_hash.
	(append_file_to_dir): Use XNEWVEC.
	(read_filename_string): Likewise. Use XRESIZEVEC too.
	(read_name_map): Cast return value of alloca.  Use XRESIZEVEC.
	(remap_filename): Use XNEWVEC.
	(struct pchf_entry): Move definition out of struct pchf_data.
	(_cpp_save_file_entries): Use XCNEWVAR.
	(_cpp_read_file_entries): Use XNEWVAR.
	* identifiers.c (alloc_node): Use XOBNEW.
	* init.c (cpp_create_reader): Use XCNEW.
	(cpp_init_builtins): Cast of b->value to enum builtin_type.
	(read_original_directory): Cast return value of alloca.
	* lex.c (add_line_note): Use XRESIZEVEC.
	(warn_about_normalization): Use XNEWVEC.
	(_cpp_lex_direct): Cast node->directive_index to (enum cpp_ttype).
	(new_buff): Use XNEWVEC.
	* line-map.c (linemap_add): Use XRESIZEVEC.
	* macro.c (builtin_macro): Cast return value of alloca.
	(paste_tokens): Likewise.
	(expand_arg): Use XNEWVEC and XRESIZEVEC.
	(_cpp_save_parameter): Use XRESIZEVEC.
	(create_iso_definition): Cast allocated storage to proper type.
	(_cpp_create_definition): Likewise.
	(cpp_macro_definition): Use XRESIZEVEC.
	* makedepend.c (add_clm): Use XNEW.
	(add_dir): Likewise.
	* mkdeps.c (munge): Use XNEWVEC.
	(deps_init): Use XCNEW.
	(deps_add_target): Use XRESIZEVEC.
	(deps_add_default_target): Cast return value of alloca.
	(deps_add_dep): Use XRESIZEVEC.
	(deps_add_vpath): Likewise.  Use XNEWVEC too.
	(deps_restore): Likewise.
	* pch.c (save_idents): Use XNEW and XNEWVEC.
	(cpp_save_state): Use XNEW.
	(count_defs): Cast return value of htab_find.
	(write_defs): Likewise.
	(cpp_write_pch_deps): Use XNEWVEC.
	(collect_ht_nodes): Use XRESIZEVEC.
	(cpp_valid_state): Use XNEWVEC.
	(save_macros): Use XRESIZEVEC.  Cast return value of xmemdup.
	* symtab.c (ht_create): Use XCNEW.
	(ht_lookup_with_hash): Cast return value of obstack_copy0.
	(ht_expand): Use XCNEWVEC.
	* system.h (HAVE_DESIGNATED_INITIALIZERS): False if __cplusplus.
	(bool): Do not define if __cplusplus.

From-SVN: r100295
2005-05-28 15:52:48 +00:00
Zack Weinberg 1ed17cd539 directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
libcpp:
	* directives.c (#sccs table entry): Mark IN_I, consistent with #ident.
	(do_sccs): Delete function definition, #define to do_ident.
	(do_ident): Don't hardwire directive name.
gcc:
	* doc/cpp.texi: Document that #sccs is a synonym for #ident.

From-SVN: r99623
2005-05-12 18:31:38 +00:00
Ryota Kunisawa 5a8c20ce52 re PR bootstrap/21230 (bootstrap failed unless bootstrap compiler is gcc.)
config/
        PR bootstrap/21230
        * warnings.m4 (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Add
        double quotes around GCC variable.

libcpp/
        PR bootstrap/21230
        * configure: Regenerate.

From-SVN: r99613
2005-05-12 12:22:08 +00:00
Andris Pavenis 473c5bc971 From Andris Pavenis, approved by Zack Weinberg, for DJGPP build problem.
* files.c: Include io.h for DJGPP to get prototype of setmode.

From-SVN: r98910
2005-04-27 19:38:59 -07:00
Per Bothner c1fc50476c re PR preprocessor/20907 (long comments throw off line numbers)
PR preprocessor/20907
	* line-map.c (linemap_line_start): Fix bug when we need to increse
	column_bits but can re-use the current line_map.

From-SVN: r98515
2005-04-21 10:08:27 -07:00
Kaveh R. Ghazi 042630ad4a system.h (fopen, [...]): Define these to the unlocked libiberty functions.
fixincludes:
	* system.h (fopen, fdopen, freopen): Define these to the unlocked
	libiberty functions.

gcc:
	* system.h (fopen, fdopen, freopen): Define these to the unlocked
	libiberty functions.

libcpp:
	* system.h (fopen, fdopen, freopen): Define these to the unlocked
	libiberty functions.

From-SVN: r98407
2005-04-19 12:37:08 +00:00
Kaveh R. Ghazi 0d667716cb configure.ac (fixincludes_UNLOCKED_FUNCS): New.
fixincludes:
	* configure.ac (fixincludes_UNLOCKED_FUNCS): New.
	(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for fixincludes_UNLOCKED_FUNCS.
	* system.h (putchar, getc, getchar, clearerr, feof, fileno,
	fflush, fgetc, fgets, ferror, fread): Redefine to the associated
	_unlocked function.
	(fwrite_unlocked): Fix prototype.

	* configure, config.h.in: Regenerate.

gcc:
	PR/17092
	* configure.ac (gcc_UNLOCKED_FUNCS): New.
	(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for gcc_UNLOCKED_FUNCS.
	* system.h (putchar, getc, getchar, clearerr, feof, fileno,
	fflush, fgetc, fgets, ferror, fread): Redefine to the associated
	_unlocked function.
	(fwrite_unlocked): Fix prototype.

	* configure, config.in: Regenerate.

libcpp:
	* configure.ac (libcpp_UNLOCKED_FUNCS): New.
	(AC_CHECK_FUNCS, AC_CHECK_DECLS): Check for libcpp_UNLOCKED_FUNCS.
	* system.h (putchar, getc, getchar, clearerr, feof, fileno,
	fflush, fgetc, fgets, ferror, fread): Redefine to the associated
	_unlocked function.
	(fwrite_unlocked): Fix prototype.

	* configure, config.in: Regenerate.

From-SVN: r97986
2005-04-11 21:46:59 +00:00
Jakub Jelinek cae064e798 re PR preprocessor/19475 (missing whitespace after macro name in C90 or C++)
PR preprocessor/19475
	* macro.c (create_iso_definition): For < ISO C99, don't
	pedwarn if there is no whitespace between macro name and its
	replacement, but the replacement starts with a basic character
	set character.

	* gcc.dg/cpp/macspace1.c: New test.
	* gcc.dg/cpp/macspace2.c: New test.

From-SVN: r97652
2005-04-05 22:07:06 +02:00
Andreas Jaeger cbada204b4 lex.c (warn_about_normalization): Cast field width to int to avoid warning.
* lex.c (warn_about_normalization): Cast field width to int to
	avoid warning.

From-SVN: r97126
2005-03-28 08:55:47 +02:00
Joseph Myers f42eccdb32 config.gcc: Consistently use solaris2.1[0-9]* instead of solaris2.1[0-9].
gcc:
	* config.gcc: Consistently use solaris2.1[0-9]* instead of
	solaris2.1[0-9].

libcpp:
	* configure.ac: Consistently use solaris2.1[0-9]* instead of
	solaris2.1[0-9].
	* configure: Regenerate.

From-SVN: r96743
2005-03-19 20:19:06 +00:00
Geoffrey Keating c79e602b63 charset.c (_cpp_valid_ucn): In identifiers, reject a partial UCN rather than printing an error.
2005-03-15  Geoffrey Keating  <geoffk@apple.com>

	* charset.c (_cpp_valid_ucn): In identifiers, reject a partial
	UCN rather than printing an error.

Index: gcc/testsuite/ChangeLog
2005-03-15  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/cpp/ucnid-7.c: New.

From-SVN: r96546
2005-03-16 00:59:31 +00:00
Geoffrey Keating 6baba9bb58 Index: libcpp/ChangeLog
2005-03-14  Geoffrey Keating  <geoffk@apple.com>

	* lex.c (forms_identifier_p): Disable UCNs in C89 mode.

Index: gcc/testsuite/ChangeLog
2005-03-14  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/cpp/ucnid-6.c: New.

From-SVN: r96475
2005-03-15 09:55:41 +00:00
Geoffrey Keating 50668cf626 Index: gcc/ChangeLog
2005-03-14  Geoffrey Keating  <geoffk@apple.com>

	* doc/cppopts.texi (-fexec-charset): Add concept index entry.
	(-fwide-exec-charset): Likewise.
	(-finput-charset): Likewise.
	* doc/invoke.texi (Warning Options): Document -Wnormalized=.
	* c-opts.c (c_common_handle_option): Handle -Wnormalized=.
	* c.opt (Wnormalized): New.

Index: libcpp/ChangeLog
2005-03-14  Geoffrey Keating  <geoffk@apple.com>

	* init.c (cpp_create_reader): Default warn_normalize to normalized_C.
	* charset.c: Update for new format of ucnid.h.
	(ucn_valid_in_identifier): Update for new format of ucnid.h.
	Add NST parameter, and update it; update callers.
	(cpp_valid_ucn): Add NST parameter, update callers.  Replace abort
	with cpp_error.
	(convert_ucn): Pass normalize_state to cpp_valid_ucn.
	* internal.h (struct normalize_state): New.
	(INITIAL_NORMALIZE_STATE): New.
	(NORMALIZE_STATE_RESULT): New.
	(NORMALIZE_STATE_UPDATE_IDNUM): New.
	(_cpp_valid_ucn): New.
	* lex.c (warn_about_normalization): New.
	(forms_identifier_p): Add normalize_state parameter, update callers.
	(lex_identifier): Add normalize_state parameter, update callers.  Keep
	the state current.
	(lex_number): Likewise.
	(_cpp_lex_direct): Pass normalize_state to subroutines.  Check
	it with warn_about_normalization.
	* makeucnid.c: New.
	* ucnid.h: Replace.
	* ucnid.pl: Remove.
	* ucnid.tab: Make appropriate for input to makeucnid.c.  Remove
	comments about obsolete version of C++.
	* include/cpplib.h (enum cpp_normalize_level): New.
	(struct cpp_options): Add warn_normalize field.

Index: gcc/testsuite/ChangeLog
2005-03-14  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/cpp/normalize-1.c: New.
	* gcc.dg/cpp/normalize-2.c: New.
	* gcc.dg/cpp/normalize-3.c: New.
	* gcc.dg/cpp/normalize-4.c: New.
	* gcc.dg/cpp/ucnid-4.c: New.
	* gcc.dg/cpp/ucnid-5.c: New.
	* g++.dg/cpp/normalize-1.C: New.
	* g++.dg/cpp/ucnid-1.C: New.

From-SVN: r96459
2005-03-15 00:36:33 +00:00
Geoffrey Keating 47e204910a Index: libcpp/ChangeLog
2005-03-12  Geoffrey Keating  <geoffk@apple.com>

	* directives.c (glue_header_name): Update call to cpp_spell_token.
	* internal.h (_cpp_interpret_identifier): New.
	* charset.c (_cpp_interpret_identifier): New.
	(_cpp_valid_ucn): Allow UCN version of '$'.
	* lex.c (lex_identifier): Add extra parameter to indicate if initial
	character was '$' or '\'.  Support identifiers with UCNs.
	(forms_identifier_p): Allow UCNs.
	(_cpp_lex_direct): Pass extra parameter to lex_identifier.
	(utf8_to_ucn): New.
	(cpp_spell_token): Add FORSTRING parameter.  Use it.
	(cpp_token_as_text): Update call to cpp_spell_token.
	(cpp_output_token): Write UCNs back out.
	(stringify_arg): Update call to cpp_spell_token.
	(paste_tokens): Likewise.
	(cpp_macro_definition): Likewise.
	* macro.c (stringify_arg): Likewise.
	(paste_tokens): Likewise.
	(cpp_macro_definition): Likewise.
	* include/cpplib.h: Add parameter to cpp_spell_token.

Index: gcc/ChangeLog
2005-03-12  Geoffrey Keating  <geoffk@apple.com>

	* c-lex.c (c_lex_with_flags): Add parameter to call to
	cpp_spell_token.

Index: gcc/testsuite/ChangeLog
2005-03-12  Geoffrey Keating  <geoffk@apple.com>

	* gcc.dg/ucnid-1.c: New.
	* gcc.dg/ucnid-2.c: New.
	* gcc.dg/ucnid-3.c: New.
	* gcc.dg/ucnid-4.c: New.
	* gcc.dg/ucnid-5.c: New.
	* gcc.dg/ucnid-6.c: New.
	* gcc.dg/cpp/ucnid-1.c: New.
	* gcc.dg/cpp/ucnid-2.c: New.
	* gcc.dg/cpp/ucnid-3.c: New.
	* g++.dg/other/ucnid-1.C: New.

From-SVN: r96333
2005-03-12 10:44:06 +00:00
Jakub Jelinek 730967114b re PR preprocessor/20282 (gcc4 can not bootstrap itself anymore)
PR bootstrap/20282
	PR bootstrap/20305
	* macro.c (replace_args, cpp_get_token): Copy whole
	cpp_token_u instead of just cpp_string field from it.

From-SVN: r95887
2005-03-04 16:33:23 +01:00
Devang Patel 2203a88104 directives.c (do_line): Save sysp early before line table is realloc'ed.
* directives.c (do_line): Save sysp early before line table is
       realloc'ed.

From-SVN: r95691
2005-02-28 11:04:19 -08:00
Zack Weinberg c5ff069dc4 re PR middle-end/18785 (isdigit builtin function fails with EBCDIC character sets)
PR 18785
libcpp:
	* charset.c (LAST_POSSIBLY_BASIC_SOURCE_CHAR): New helper macro.
	(cpp_host_to_exec_charset): New function.
	* include/cpplib.h: Declare cpp_host_to_exec_charset.

gcc:
	* langhooks.h (struct lang_hooks): Add to_target_charset.
	* langhooks.c (lhd_to_target_charset): New function.
	* langhooks-def.h: Declare lhd_to_target_charset.
	(LANG_HOOKS_TO_TARGET_CHARSET): New macro.
	(LANG_HOOKS_INITIALIZER): Update.
	* c-common.c (c_common_to_target_charset): New function.
	* c-common.h: Declare it.
	* c-objc-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
	c_common_to_target_charset.

	* defaults.c (TARGET_BELL, TARGET_BS, TARGET_CR, TARGET_DIGIT0)
	(TARGET_ESC, TARGET_FF, TARGET_NEWLINE, TARGET_TAB, TARGET_VT):
	Delete definitions.
	* system.h: Poison them.
	* doc/tm.texi: Don't discuss them.
	* builtins.c (fold_builtin_isdigit): Use lang_hooks.to_target_charset.
	* c-pretty-print.c (pp_c_integer_constant): Don't use pp_c_char.
	(pp_c_char): Do not attempt to generate letter escapes for
	newline, tab, etc.
	* config/arm/arm.c (output_ascii_pseudo_op): Likewise.
	* config/mips/mips.c (mips_output_ascii): Likewise.
gcc/cp:
	* cp-objcp-common.h (LANG_HOOKS_TO_TARGET_CHARSET): Set to
	c_common_to_target_charset.  Delete bogus comment.
gcc/testsuite:
	* gcc.dg/charset/builtin1.c: New test.

From-SVN: r95304
2005-02-20 17:01:32 +00:00
Devang Patel 04c90eea07 charset.c (_cpp_convert_input): Check '\r' before inserting '\n' at the end.
* charset.c (_cpp_convert_input): Check '\r' before inserting
      '\n' at the end.
      * gcc.dg/cpp/mac-eol-at-eof.c: New test.

From-SVN: r95289
2005-02-19 11:48:02 -08:00
Eric Christopher 6da55c0077 re PR preprocessor/19077 (Internal compiler error compiling MPlayer)
2005-02-15  Eric Christopher  <echristo@redhat.com>

	PR preprocessor/19077
	* macro.c (cpp_macro_definition): Move handling of whitespace
	to PREV_WHITE conditional. Remove overloading of len
	variable.

2005-02-15  Eric Christopher  <echristo@redhat.com>

	* gcc.dg/cpp/20050215-1.c: New file.

From-SVN: r95080
2005-02-15 23:18:04 +00:00
Kazu Hirata 31c3e63157 directives.c, [...]: Update copyright.
* directives.c, files.c, init.c, internal.h, macro.c, pch.c,
	traditional.c: Update copyright.

From-SVN: r95012
2005-02-14 14:43:56 +00:00
Paolo Bonzini be0f1e5478 re PR bootstrap/19818 (GCC 4.0 cannot bootstrap itself)
include:
2005-02-08  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/19818
	* ansidecl.h (PARAMS): Guard from redefinition.

libcpp:
2005-02-08  Paolo Bonzini  <bonzini@gnu.org>

	PR bootstrap/19818
	* configure.ac: Check for declaration of basename and getopt.
	* config.in: Regenerate.
	* configure: Regenerate.
	* internal.h (ustrcspn): New.
	* macro.c (create_iso_definition): Fix allocation of memory.
	(padding_token): Add cast to remove const-ness.
	* pch.c (cpp_read_state): Use ustrcspn.

From-SVN: r95003
2005-02-14 08:52:24 +00:00
Mike Stump ecddfb399a files.c (pchf_adder): Remove.
* files.c (pchf_adder): Remove.
        (struct pchf_adder_info): Likewise.
        (_cpp_save_file_entries): Write out all files so that #import works.

From-SVN: r94755
2005-02-09 01:23:56 +00:00
Joseph Myers 9fcdd8917c re PR bootstrap/18058 (Bootstrap fails with non-GCC compilers)
config:
	* warnings.m4 (ACX_PROG_CC_WARNING_ALMOST_PEDANTIC): Don't do
	anything for non-GCC compilers.

libcpp:
	* configure: Regenerate.

gcc:
	PR bootstrap/18058
	* recog.c (recog_memoized): Don't define if GENERATOR_FILE.
	* ggc-none.c (ggc_free): Define.

From-SVN: r94123
2005-01-23 19:22:01 +00:00
Tobias Schlüter 6c25a4f7cb * include/cpplib.h: Also update copyright years.
From-SVN: r93191
2005-01-11 19:24:12 +01:00
Tobias Schlüter ecfd72e739 * include/cpplib.h (c_lang): Fix comment to say cpp_create_reader.
From-SVN: r93190
2005-01-11 19:19:56 +01:00
Geoffrey Keating 942926ad9a Index: libcpp/ChangeLog
2005-01-03  Geoffrey Keating  <geoffk@apple.com>

	* files.c (_cpp_find_file): Add files found by search_path_exhausted
	to the list of all files.

Index: gcc/testsuite/ChangeLog
2005-01-03  Geoffrey Keating  <geoffk@apple.com>
	    Robert Bowdidge <bowdidge@apple.com>

	* gcc.dg/cpp/subframework1.c: New.
	* gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/A.h: New.
	* gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/B.h: New.
	* gcc.dg/cpp/frame/one.framework/Frameworks/OneSub.framework/Headers/C.h: New.
	* gcc.dg/cpp/frame/one.framework/Headers/one-includeSubs.h: New.

Co-Authored-By: Robert Bowdidge <bowdidge@apple.com>

From-SVN: r92883
2005-01-04 02:13:56 +00:00
Gabriel Dos Reis a2566ae98d internal.h: Update references to Cpp lib filenames.
* internal.h: Update references to Cpp lib filenames.
        * directives.c: Likewise.
        * init.c: Likewise.
        * macro.c: Likewise.
        * traditional.c: Likewise.

From-SVN: r92799
2005-01-02 01:32:21 +00:00
Eric Botcazou 1b449375c5 re PR preprocessor/15167 (Internal compiler error with "#pragma once")
PR preprocessor/15167
	* files.c (destroy_cpp_file): New function.
	(should_stack_file): Make a new file if the
	compared file is still stacked.

From-SVN: r92194
2004-12-15 13:31:28 +00:00
Nathanael Nerode 283038288e re PR preprocessor/17610 (Empty #include statement halts gcc)
(libcpp)
	PR preprocessor/17610
	* directives.c (do_include_common): Error out if an empty filename
	is given for #include (or #include_next or #import).

(gcc)
	PR preprocessor/17610
	* testsuite/gcc.dg/cpp/empty-include.c: New testcase.

From-SVN: r91428
2004-11-28 22:28:13 +00:00
Roger Sayle c812785aaa internal.h: Replace all uses of uchar with unsigned char.
* internal.h: Replace all uses of uchar with unsigned char.
	* include/cpp-id-data.h: Likewise.  Guard typedef of uchar
	with !IN_GCC, so uchar is only defined whilst building libcpp.

Co-Authored-By: Zack Weinberg <zack@codesourcery.com>

From-SVN: r91394
2004-11-27 21:59:38 +00:00
Kelley Cook f91eaa015a aclocal.m4: Regenerate.
2004-11-24  Kelley Cook  <kcook@gcc.gnu.org>

	* aclocal.m4: Regenerate.

From-SVN: r91199
2004-11-24 21:53:28 +00:00
Roger Sayle f78ce0c2f3 re PR preprocessor/15824 (uchar redefinition warnings in libcpp)
PR preprocessor/15824
	* configure.ac: Correct HAVE_UCHAR test to #include <sys/types.h>
	directly, instead of the non-existant "system.h" and "ansidecl.h".
	* configure: Regenerate.

From-SVN: r91157
2004-11-24 14:00:38 +00:00
Daniel Jacobowitz b5b3e36a98 sol2-c.c (solaris_register_pragmas): Use c_register_pragma_with_expansion.
gcc:
2004-11-23  Daniel Jacobowitz  <dan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* config/sol2-c.c (solaris_register_pragmas): Use
	c_register_pragma_with_expansion.
	* config/sol2.h (HANDLE_PRAGMA_PACK_WITH_EXPANSION): Define.
	* c-pragma.c (c_register_pragma): Update call to
	cpp_register_pragma.
	(c_register_pragma_with_expansion): New function.
	(init_pragma): Honor HANDLE_PRAGMA_PACK_WITH_EXPANSION.
	* c-pragma.h (c_register_pragma_with_expansion): New prototype.
	* doc/extend.texi (Solaris Pragmas): Mention macro expansion for
	#pragma align.
	* doc/tm.texi (c_register_pragma_with_expansion,
	HANDLE_PRAGMA_PACK_WITH_EXPANSION): Document.

gcc/testsuite:
2004-11-23  Daniel Jacobowitz  <dan@codesourcery.com>

	* gcc.dg/pragma-align-2.c: Test macro expansion.
	* gcc.dg/pragma-pack-2.c: New test.

libcpp:
2004-11-23  Daniel Jacobowitz  <dan@codesourcery.com>
            Joseph Myers  <joseph@codesourcery.com>

	* internal.h (struct lexer_state): Add in_deferred_pragma.
	* directives.c (struct pragma_entry): Add allow_expansion.
	(insert_pragma_entry): Take allow_expansion flag.
	(register_pragma): Likewise.
	(cpp_register_pragma): Likewise.
	(_cpp_init_internal_pragmas): Update calls to cpp_register_pragma.
	(do_pragma): Honor allow_expansion.
	(cpp_handle_deferred_pragma): Set in_deferred_pragma.
	* include/cpplib.h (cpp_register_pragma): Update prototype.

Co-Authored-By: Joseph Myers <joseph@codesourcery.com>

From-SVN: r91117
2004-11-23 23:25:40 +00:00
Daniel Jacobowitz a8e6802924 configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set need_64bit_hwint=yes.
libcpp:
2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
            Mark Mitchell  <mark@codesourcery.com>

	* configure.ac (i[34567]86-*-solaris2.1[0-9]*): Set
	need_64bit_hwint=yes.
	* configure: Regenerate.

gcc:
2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
            Mark Mitchell  <mark@codesourcery.com>

	* config/i386/sol2-10.h, config/i386/t-sol2-10: New files.
	* config/i386/i386.c (i386_solaris_elf_named_section): New
	function.
	* config.gcc (i[34567]86-*-solaris2*): Handle Solaris 2.10.
	* config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Handle
	64-bit.
	(ASM_QUAD): Don't undefine for biarch targets.
	* config/i386/t-sol2: Introduce multilib support.

gcc/testsuite:
2004-11-18  Daniel Jacobowitz  <dan@codesourcery.com>
            Mark Mitchell  <mark@codesourcery.com>

	* testsuite/gcc.dg/pragma-init-fini-2.c: New test.

Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r90839
2004-11-18 01:07:18 +00:00
Joseph Myers 50f47ee0cd Makefile.in ($(PACKAGE).pot): New rule.
* Makefile.in ($(PACKAGE).pot): New rule.  Depend on
	po/$(PACKAGE).pot.
	(po/$(PACKAGE).pot): Use ":" instead of "," in --keyword
	arguments.  Add keywords _, N_, SYNTAX_ERROR and SYNTAX_ERROR2.
	Remove local srcdir path from generated file.

From-SVN: r90368
2004-11-09 21:58:43 +00:00