Commit Graph

9 Commits

Author SHA1 Message Date
Jakub Jelinek
66647d441f Update Copyright years for files modified in 2008 and/or 2009.
From-SVN: r144324
2009-02-20 16:20:38 +01:00
Ian Lance Taylor
d75d71e0ac c-lex.c (narrowest_unsigned_type): Change itk to int.
* c-lex.c (narrowest_unsigned_type): Change itk to int.
	(narrowest_signed_type): Likewise.
	* c-typeck.c (c_common_type): Change local variable mclass to enum
	mode_class, twice.
	(parser_build_binary_op): Compare the TREE_CODE_CLASS with
	tcc_comparison, not the tree code itself.
	* c-common.c (def_fn_type): Pass int, not an enum, to va_arg.
	(c_expand_expr): Cast modifier to enum expand_modifier.
	* c-common.h (C_RID_CODE): Add casts.
	(C_SET_RID_CODE): Define.
	* c-parser.c (c_parse_init): Use C_SET_RID_CODE.
	(c_lex_one_token): Add cast to avoid warning.
	(c_parser_objc_type_name): Rename local typename to type_name.
	(check_no_duplicate_clause): Change code parameter to enum
	omp_clause_code.
	(c_parser_omp_var_list_parens): Change kind parameter to enum
	omp_clause_code.
	(c_parser_omp_flush): Pass OMP_CLAUSE_ERROR, not 0, to
	c_parser_omp_list_var_parens.
	(c_parser_omp_threadprivate): Likewise.
	* cp/lex.c (init_reswords): Use C_SET_RID_CODE.
	* cp/parser.c (cp_lexer_get_preprocessor_token): Likewise.
	* c-format.c (NO_FMT): Define.
	(printf_length_specs): Use NO_FMT.
	(asm_fprintf_length_specs): Likewise.
	(gcc_diag_length_specs): Likewise.
	(scanf_length_specs): Likewise.
	(strfmon_length_specs): Likewise.
	(gcc_gfc_length_specs): Likewise.
	(printf_flag_specs): Change 0 to STD_C89.
	(asm_fprintf_flag_specs): Likewise.
	(gcc_diag_flag_specs): Likewise.
	(gcc_cxxdiag_flag_specs): Likewise.
	(scanf_flag_specs): Likewise.
	(strftime_flag_specs): Likewise.
	(strfmon_flag_specs): Likewise.
	(print_char_table): Likewise.
	(asm_fprintf_char_table): Likewise.
	(gcc_diag_char_table): Likewise.
	(gcc_tdiag_char_table): Likewise.
	(gcc_cdiag_char_table): Likewise.
	(gcc_cxxdiag_char_table): Likewise.
	(gcc_gfc_char_table): Likewise.
	(scan_char_table): Likewise.
	(time_char_table): Likewis.
	(monetary_char_table): Likewise.
	* c-format.h (BADLEN): Likewise.

From-SVN: r137019
2008-06-22 14:56:08 +00:00
Kai Tietz
6590fc9fbd ms format support for mingw.
for gcc:
	* c-format.c (replace_format_name_to_system_name): New.
	(cmp_attribs): New.
	(convert_format_name_to_system_name): New.
	(decode_format_attr): Add use of convert_format_name_to_system_name.
	(format_types_orig): Add gnu_ prefix to names.
	(check_format_info_main): Special treating of \0 escaped names for
	supporting multi-character format specifiers as I32, I64.
	(TARGET_OVERRIDES_FORMAT_ATTRIBUTES): Use of user defined attributes.
	(gnu_target_overrides_format_attributes): New.
	* c-format.h: Add structure target_ovr_attr to hold
	system specific formatter names.
	* config.gcc: Add for x86&x86_64 cygwin and mingw32 targets the
	msformat-c.o file to c_target_objs and cxx_target_objs.
	* config/i386/mingw32.h (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): New.
	(TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT): New.
	(TARGET_N_FORMAT_TYPES): New.
	* config/i386/msformat-c.c: New.
	* config/i386/t-cygming: Add build rule for msformat-c.o.
	* doc/extend.texi: Add new format names gnu_* and ms_* and
	further details.
	* doc/tm.texi: (TARGET_OVERRIDES_FORMAT_ATTRIBUTES): New.

for gcc/testsuite/

	* gcc.dg/format/ms_array-1.c: New.
	* gcc.dg/format/ms_c90-scanf-3.c: New.
	* gcc.dg/format/ms_c99-strftime-1.c: New.
	* gcc.dg/format/ms_no-y2k-1.c: New.
	* gcc.dg/format/ms_attr-1.c: New.
	* gcc.dg/format/ms_c90-scanf-4.c: New.
	* gcc.dg/format/ms_c99-strftime-2.c: New.
	* gcc.dg/format/ms_nonlit-1.c: New.
	* gcc.dg/format/ms_c90-scanf-5.c: New.
	* gcc.dg/format/ms_cast-1.c: New.
	* gcc.dg/format/ms_nonlit-2.c: New.
	* gcc.dg/format/ms_attr-2.c: New.
	* gcc.dg/format/ms_c90-strftime-1.c: New.
	* gcc.dg/format/ms_miss-1.c: New.
	* gcc.dg/format/ms_nonlit-3.c: New.
	* gcc.dg/format/ms_attr-3.c: New.
	* gcc.dg/format/ms_c90-strftime-2.c: New.
	* gcc.dg/format/ms_miss-2.c: New.
	* gcc.dg/format/ms_nul-1.c: New.
	* gcc.dg/format/ms_attr-4.c: New.
	* gcc.dg/format/ms_c94-printf-1.c: New.
	* gcc.dg/format/ms_miss-3.c: New.
	* gcc.dg/format/ms_nul-2.c: New.
	* gcc.dg/format/ms_attr-7.c: New.
	* gcc.dg/format/ms_c94-scanf-1.c: New.
	* gcc.dg/format/ms_miss-4.c: New.
	* gcc.dg/format/ms_null-1.c: New.
	* gcc.dg/format/ms_bitfld-1.c: New.
	* gcc.dg/format/ms_c99-printf-1.c: New.
	* gcc.dg/format/ms_miss-5.c: New.
	* gcc.dg/format/ms_plus-1.c: New.
	* gcc.dg/format/ms_branch-1.c: New.
	* gcc.dg/format/ms_c99-printf-2.c: New.
	* gcc.dg/format/ms_miss-6.c: New.
	* gcc.dg/format/ms_sec-1.c: New.
	* gcc.dg/format/ms_c90-printf-1.c: New.
	* gcc.dg/format/ms_c99-printf-3.c: New.
	* gcc.dg/format/ms_multattr-1.c: New.
	* gcc.dg/format/ms_unnamed-1.c: New.
	* gcc.dg/format/ms_c90-printf-2.c: New.
	* gcc.dg/format/ms_c99-scanf-1.c: New.
	* gcc.dg/format/ms_multattr-2.c: New.
	* gcc.dg/format/ms_va-1.c: New.
	* gcc.dg/format/ms_c90-printf-3.c: New.
	* gcc.dg/format/ms_c99-scanf-2.c: New.
	* gcc.dg/format/ms_multattr-3.c: New.
	* gcc.dg/format/ms_warnll-1.c: New.
	* gcc.dg/format/ms_c90-scanf-1.c: New.
	* gcc.dg/format/ms_c99-scanf-3.c: New.
	* gcc.dg/format/ms_no-exargs-1.c: New.
	* gcc.dg/format/ms_zero-length-1.c: New.
	* gcc.dg/format/ms_c90-scanf-2.c: New.
	* gcc.dg/format/ms_c99-scanf-4.c: New.
	* gcc.dg/format/ms_no-exargs-2.c: New.
	* gcc.dg/format/null-1.c: Add gnu style usage for mingw.
	* gcc.dg/format/miss-1.c: Likewise.
	* gcc.dg/format/miss-3.c: Likewise.
	* gcc.dg/format/multattr-2.c: Likewise.
	* gcc.dg/format/miss-5.c: Likewise.
	* gcc.dg/format/attr-2.c: Likewise.
	* gcc.dg/format/attr-4.c: Likewise.
	* gcc.dg/format/c90-scanf-4.c: Likewise.
	* gcc.dg/format/c99-printf-3.c: Likewise.
	* gcc.dg/format/multattr-1.c: Likewise.
	* gcc.dg/format/miss-4.c: Likewise.
	* gcc.dg/format/miss-6.c: Likewise.
	* gcc.dg/format/c90-printf-3.c: Likewise.
	* gcc.dg/format/attr-1.c: Likewise.
	* gcc.dg/format/attr-3.c: Likewise.
	* gcc.dg/format/attr-7.c: Likewise.
	* gcc.dg/format/format.h: Treat mingw and gnu style.
	* gcc.dg/format/sys_format.c: New.

From-SVN: r133365
2008-03-20 09:24:42 +01:00
Jakub Jelinek
9cef5f55ff c-format.h (format_kind_info): Add alloc_char field.
* c-format.h (format_kind_info): Add alloc_char field.
	* c-format.c (scanf_flag_specs): Add 'm'.
	(scanf_flag_pairs): Add 'a', 'm' pair.
	(scan_char_table): Allow 'm' modifier for c, s, [, C and S.
	(format_types_orig): Add alloc_char fields.
	(check_format_info_main): Rename aflag to alloc_flag.
	Handle fki->alloc_char. modifier after width and before length
	modifiers.  Move FMT_FLAG_SCANF_A_KLUDGE handling before
	length modifiers as well.
	* config/sol2-c.c (solaris_format_types): Add alloc_char field.

	* gcc.dg/format/c90-scanf-5.c: New test.
	* gcc.dg/format/c99-scanf-4.c: New test.
	* gcc.dg/format/ext-7.c: New test.
	* gcc.dg/format/ext-8.c: New test.

From-SVN: r128555
2007-09-18 00:07:46 +02:00
Nick Clifton
9dcd6f09a3 Change copyright header to refer to version 3 of the GNU General Public License and to point readers at the COPYING3 file and the FSF's license web page.
From-SVN: r126948
2007-07-26 08:37:01 +00:00
Jon Grimm
9a8ce21f3b target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): New.
2005-12-16  Jon Grimm  <jgrimm2@us.ibm.com>
	    Janis Johnson  <janis187@us.ibm.com>
	    Ben Elliston  <bje@au.ibm.com>

	* target-def.h (TARGET_DECIMAL_FLOAT_SUPPORTED_P): New.
	(TARGET_INITIALIZER): Add TARGET_DECIMAL_FLOAT_P.
	* target.h (struct gcc_target): Add decimal_float_supported_p.
	* targhooks.c (default_scalar_mode_supported_p): Handle
	MODE_DECIMAL_FLOAT.
	* builtins.def: Add new builtins for 32, 64 and 128 bit variants
	of inf, nan, finite, isinf and isnan.
	* builtin-types.def (BT_DFLOAT32, BT_DFLOAT64, BT_DFLOAT128,
	BT_DFLOAT32_PTR, BT_DFLOAT64_PTR, BT_DFLOAT128_PTR,
	BT_FN_DFLOAT32, BT_FN_DFLOAT64, BT_FN_DFLOAT128,
	BT_FN_INT_DFLOAT32, BT_FN_INT_DFLOAT64, BT_FN_INT_DFLOAT128,
	BT_FN_DFLOAT32_CONST_STRING, BT_FN_DFLOAT64_CONST_STRING,
	BT_FN_DFLOAT32_CONST_STRING, BT_FN_DFLOAT32_DFLOAT32,
	BT_FN_DFLOAT64_DFLOAT64, BT_FN_DFLOAT128_DFLOAT128): New.
	* c-decl.c (declspecs_add_type): Verify combos on type qualifiers.
	Pedwarn if decimal floating point types are used.  Error if
	decimal floating point is not supported by the target.
	(finish_declspecs): Return type from DFP typespec_word.
	* c-typeck.c (c_common_type): Choose the decimal floating point
	type with the greater precision when determining a common type.
	(convert_arguments): Warn if there is a mismatch between argument
	and prototype for decimal float types.  Warn of conversions with
	binary float types and of precision narrowing due to prototype.
	* c-parser.c (reswords): Add _Decimal32, _Decimal64, _Decimal128.
	(c_token_starts_typename): Handle RID_DFLOAT32/64/128.
	(c_token_starts_declspecs): Likewise.
	(c_parser_attributes): Likewise.
	* c-common.h (enum rid): Add new enumeration values RID_DFLOAT32,
	RID_DFLOAT64, RID_DFLOAT128.
	(T_D32, TEX_D32, T_D64, TEX_D64, T_D128, TEX_D128): New macros.
	* c-common.c (c_common_type_for_mode): Handle decimal float modes.
	(shorten_compare): Convert DFP/BFP operands to a common type.
	(c_common_modes_and_builtins): Register built-in decimal float
	types if the target supports them.
	(handle_mode_addtribute): Handle MODE_DECIMAL_FLOAT.
	* builtins.c (fold_builtin_1): Handle 32, 64 and 128 bit cases of
	inf, nan, finite, isinf and isnan builtins.
	* c-cppbuiltin.c (builtin_define_decimal_float_constants): New.
	(builtin_define_float_constants): Assert non-decimal radix.
	(c_cpp_builtins): Register built-in __DEC_EVAL_METHOD__ define.
	Call builtin_define_decimal_float_constants for each type.
	* c-lex.c (interpret_float): Decode decimal float types from CPP_N
	flags.  Use real_from_string3, which can handle binary or decimal
	floats.
	* c-tree.h (enum c_typespec_keyword): Add cts_dfloat32,
	cts_dfloat64, cts_dfloat128.
	* tree.c (build_common_tree_nodes_2): Add decimal float types.
	* tree.h (enum tree_index): Add new enumeration values
	TI_DFLOAT32_TYPE, TI_DFLOAT64_TYPE, TI_DFLOAT128_TYPE,
	TI_DFLOAT32_PTR_TYPE, TI_DFLOAT64_PTR_TYPE, TI_DFLOAT128_PTR_TYPE.
	(dfloat32_type_node): New macro.
	(dfloat64_type_node, dfloat128_type_node): Likewise.
	(dfloat32_ptr_type_node, dfloat64_ptr_type_node): Likewise.
	(dfloat128_ptr_type_node): Likewise.
	* c-pretty-print.c (pp_c_floating_constant): Append 32, 64 and 128
	bit decimal floating point types with "df", "dd" and "dl".
	* c-format.h (enum format_lengths): Add new enumeration values
	FMT_LEN_H, FMT_LEN_D and FMT_LEN_DD.
	* c-format.c (printf_length_specs, scanf_length_specs): Add
	entries for H, D, DD.
	(print_char_table, scan_char_table): Use new entries.
	(asm_fprintf_char_table, gcc_diag_char_table,
	gcc_cdiag_char_table, gcc_cxxdiag_char_table): Adjust for longer
	length arrays.
	* defaults.h (DECIMAL32_TYPE_SIZE): Define.
	(DECIMAL64_TYPE_SIZE): Likewise.
	(DECIMAL128_TYPE_SIZE): Likewise.
	(TARGET_DEC_EVAL_METHOD): Likewise.
	* doc/extend.texi (Decimal Float): New node.
	(Constructing Calls): Document decimal float built-ins.
	* doc/tm.texi: Document TARGET_DECIMAL_FLOAT_SUPPORTED_P hook.
	* Makefile.in (USER_H): Add $(srcdir)/ginclude/decfloat.h.
	* ginclude/decfloat.h: New file.

Co-Authored-By: Ben Elliston <bje@au.ibm.com>
Co-Authored-By: Janis Johnson <janis187@us.ibm.com>

From-SVN: r108629
2005-12-16 17:38:26 +11:00
Kelley Cook
366ccddb2b Update FSF address.
From-SVN: r101317
2005-06-25 02:02:01 +00:00
Joseph Myers
9e637a2679 builtins.c, [...]: Avoid "`" as left quote, using "'" or %q, %< and %> as appropriate.
* builtins.c, c-common.c, c-decl.c, c-format.c, c-format.h,
	c-parse.in, c-pch.c, c-pragma.c, collect2.c, final.c, gcc.c,
	gcov.c, opts.c, pretty-print.h, protoize.c, reg-stack.c, rtl.c,
	tlink.c, config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c,
	config/avr/avr.c, config/c4x/c4x.c, config/darwin.c,
	config/frv/frv.c, config/h8300/h8300.c, config/i386/i386.c,
	config/i386/winnt.c, config/ia64/ia64.c, config/ip2k/ip2k.c,
	config/iq2000/iq2000.c, config/m32r/m32r.c,
	config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/m68k/m68k.h,
	config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c,
	config/ns32k/ns32k.c, config/rs6000/host-darwin.c,
	config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c,
	config/sh/symbian.c, config/stormy16/stormy16.c,
	config/v850/v850.c: Avoid "`" as left quote, using "'" or %q, %<
	and %> as appropriate.  Use %' as apostrophe in diagnostics where
	applicable.  Use %< and %> in place of '' quotes where applicable.
	Use %qs in place of %<%s%>.  Consistently quote __builtin function
	names.

ada:
	* misc.c (gnat_handle_option): Use %< and %> for quoting in
	warning message.

cp:
	* call.c, class.c, decl.c, decl2.c, error.c, mangle.c, parser.c,
	pt.c, search.c, semantics.c, typeck.c: Use %q, %< and %> for
	quoting in diagnostics.
	* parser.c (cp_parser_sizeof_operand): Use '' instead of `' for
	quoting in printf format.
	* decl.c (duplicate_decls, start_decl): Use %qD instead of
	unquoted %D.

objc:
	* objc-act.c: Use %q, %< and %> for quoting in diagnostics.

testsuite:
	* gcc.dg/builtin-prefetch-1.c: Adjust expected messages.

From-SVN: r90337
2004-11-09 10:13:30 +00:00
Daniel Jacobowitz
a2bec81863 Makefile.in (c-format.o): Depend on c-format.h.
gcc/
	* Makefile.in (c-format.o): Depend on c-format.h.
	* c-format.h: New file.
	(struct format_char_info): Add CHAIN member.
	* c-format.c: Move some types and constants to c-format.h.
	(format_type_error): Set to -1.
	(struct function_format_info): Use an int for format_type.
	(decode_format_type): Return an int.  Return format_type_error
	on error.
	(print_char_table, asm_fprintf_char_table, gcc_diag_char_table)
	(gcc_diag_char_table, gcc_cdiag_char_table, gcc_cxxdiag_char_table)
	(scan_char_table, time_char_table, monetary_char_table): Initialize
	CHAIN to NULL.
	(n_format_types): New variable.
	(check_format_info_main): Handle CHAIN in format_char_info.
	(handle_format_attribute): Handle TARGET_FORMAT_TYPES and
	TARGET_N_FORMAT_TYPES.
	* config.gcc (i[34567]86-*-solaris2*, sparc64-*-solaris2*)
	(sparc-*-solaris2*): Include config/t-sol2 and config/sol2-c.c.
	* config/sol2-c.c: New file.
	* config/t-sol2: New file.
	* config/sol2.h (TARGET_N_FORMAT_TYPES, TARGET_FORMAT_TYPES): Define.
	* config/sparc/elf.h, config/sparc/sp64-elf.h: Undefine
	TARGET_N_FORMAT_TYPES and TARGET_FORMAT_TYPES.

	* doc/extend.texi (Target Format Checks): New section.
	(Function Attributes): Mention it.
	* doc/invoke.texi: Mention target format checks.
	* doc/sourcebuild.texi: Mention target format checks.
	* dc/tm.texi (Misc): Document TARGET_N_FORMAT_TYPES and
	TARGET_FORMAT_TYPES.
testsuite/
	* gcc.dg/format/cmn-err-1.c: New test.

From-SVN: r84920
2004-07-19 14:48:09 +00:00