#include "config.h"#include "system.h"#include "tree.h"#include "flags.h"#include "toplev.h"#include "c-common.h"#include "intl.h"#include "diagnostic.h"#include "langhooks.h"

Go to the source code of this file.
Data Types | |
| type | function_format_info |
| type | format_length_info |
| type | format_type_detail |
| type | format_char_info |
| type | format_flag_spec |
| type | format_flag_pair |
| type | format_kind_info |
| type | format_wanted_type |
| type | format_check_results |
| type | format_check_context |
Defines | |
| #define | CPLUSPLUS_STD_VER STD_C94 |
| #define | C_STD_VER |
| #define | C_STD_NAME(FEATURE_VER) |
| #define | ADJ_STD(VER) |
| #define | BADLEN { 0, NULL, NULL } |
| #define | NOLENGTHS { BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN } |
| #define | T_I &integer_type_node |
| #define | T89_I { STD_C89, NULL, T_I } |
| #define | T_L &long_integer_type_node |
| #define | T89_L { STD_C89, NULL, T_L } |
| #define | T_LL &long_long_integer_type_node |
| #define | T9L_LL { STD_C9L, NULL, T_LL } |
| #define | TEX_LL { STD_EXT, NULL, T_LL } |
| #define | T_S &short_integer_type_node |
| #define | T89_S { STD_C89, NULL, T_S } |
| #define | T_UI &unsigned_type_node |
| #define | T89_UI { STD_C89, NULL, T_UI } |
| #define | T_UL &long_unsigned_type_node |
| #define | T89_UL { STD_C89, NULL, T_UL } |
| #define | T_ULL &long_long_unsigned_type_node |
| #define | T9L_ULL { STD_C9L, NULL, T_ULL } |
| #define | TEX_ULL { STD_EXT, NULL, T_ULL } |
| #define | T_US &short_unsigned_type_node |
| #define | T89_US { STD_C89, NULL, T_US } |
| #define | T_F &float_type_node |
| #define | T89_F { STD_C89, NULL, T_F } |
| #define | T99_F { STD_C99, NULL, T_F } |
| #define | T_D &double_type_node |
| #define | T89_D { STD_C89, NULL, T_D } |
| #define | T99_D { STD_C99, NULL, T_D } |
| #define | T_LD &long_double_type_node |
| #define | T89_LD { STD_C89, NULL, T_LD } |
| #define | T99_LD { STD_C99, NULL, T_LD } |
| #define | T_C &char_type_node |
| #define | T89_C { STD_C89, NULL, T_C } |
| #define | T_SC &signed_char_type_node |
| #define | T99_SC { STD_C99, NULL, T_SC } |
| #define | T_UC &unsigned_char_type_node |
| #define | T99_UC { STD_C99, NULL, T_UC } |
| #define | T_V &void_type_node |
| #define | T89_V { STD_C89, NULL, T_V } |
| #define | T_W &wchar_type_node |
| #define | T94_W { STD_C94, "wchar_t", T_W } |
| #define | TEX_W { STD_EXT, "wchar_t", T_W } |
| #define | T_WI &wint_type_node |
| #define | T94_WI { STD_C94, "wint_t", T_WI } |
| #define | TEX_WI { STD_EXT, "wint_t", T_WI } |
| #define | T_ST &size_type_node |
| #define | T99_ST { STD_C99, "size_t", T_ST } |
| #define | T_SST &signed_size_type_node |
| #define | T99_SST { STD_C99, "signed size_t", T_SST } |
| #define | T_PD &ptrdiff_type_node |
| #define | T99_PD { STD_C99, "ptrdiff_t", T_PD } |
| #define | T_UPD &unsigned_ptrdiff_type_node |
| #define | T99_UPD { STD_C99, "unsigned ptrdiff_t", T_UPD } |
| #define | T_IM &intmax_type_node |
| #define | T99_IM { STD_C99, "intmax_t", T_IM } |
| #define | T_UIM &uintmax_type_node |
| #define | T99_UIM { STD_C99, "uintmax_t", T_UIM } |
Enumerations | |
| enum | format_type { printf_format_type, scanf_format_type, strftime_format_type, strfmon_format_type, format_type_error, printf_format_type, scanf_format_type, strftime_format_type, strfmon_format_type, format_type_error, printf_format_type, asm_fprintf_format_type, gcc_diag_format_type, gcc_cdiag_format_type, gcc_cxxdiag_format_type, scanf_format_type, strftime_format_type, strfmon_format_type, format_type_error = -1, printf_format_type, asm_fprintf_format_type, gcc_diag_format_type, gcc_tdiag_format_type, gcc_cdiag_format_type, gcc_cxxdiag_format_type, gcc_gfc_format_type, scanf_format_type, strftime_format_type, strfmon_format_type, format_type_error = -1 } |
| enum | format_lengths { FMT_LEN_none, FMT_LEN_hh, FMT_LEN_h, FMT_LEN_l, FMT_LEN_ll, FMT_LEN_L, FMT_LEN_z, FMT_LEN_t, FMT_LEN_j, FMT_LEN_MAX, FMT_LEN_none, FMT_LEN_hh, FMT_LEN_h, FMT_LEN_l, FMT_LEN_ll, FMT_LEN_L, FMT_LEN_z, FMT_LEN_t, FMT_LEN_j, FMT_LEN_MAX, FMT_LEN_none, FMT_LEN_hh, FMT_LEN_h, FMT_LEN_l, FMT_LEN_ll, FMT_LEN_L, FMT_LEN_z, FMT_LEN_t, FMT_LEN_j, FMT_LEN_MAX, FMT_LEN_none, FMT_LEN_hh, FMT_LEN_h, FMT_LEN_l, FMT_LEN_ll, FMT_LEN_L, FMT_LEN_z, FMT_LEN_t, FMT_LEN_j, FMT_LEN_H, FMT_LEN_D, FMT_LEN_DD, FMT_LEN_MAX } |
| enum | format_std_version { STD_C89, STD_C94, STD_C9L, STD_C99, STD_EXT, STD_C89, STD_C94, STD_C9L, STD_C99, STD_EXT, STD_C89, STD_C94, STD_C9L, STD_C99, STD_EXT, STD_C89, STD_C94, STD_C9L, STD_C99, STD_EXT } |
| enum | { FMT_FLAG_ARG_CONVERT = 1, FMT_FLAG_SCANF_A_KLUDGE = 2, FMT_FLAG_FANCY_PERCENT_OK = 4, FMT_FLAG_DOLLAR_MULTIPLE = 8, FMT_FLAG_USE_DOLLAR = 16, FMT_FLAG_ZERO_WIDTH_BAD = 32, FMT_FLAG_EMPTY_PREC_OK = 64, FMT_FLAG_DOLLAR_GAP_POINTER_OK = 128 } |
Functions/Subroutines | |
| void | set_Wformat (int setting) |
| static bool decode_format_attr | PARAMS ((tree, function_format_info *, int)) |
| static enum format_type decode_format_type | PARAMS ((const char *)) |
| tree | handle_format_attribute (tree *node, name, tree args, int flags, bool *no_add_attrs) |
| tree | handle_format_arg_attribute (tree *node, name, tree args, int flags, bool *no_add_attrs) |
| static bool | decode_format_attr (tree args, function_format_info *info, int validated_p) |
| static void check_format_info | PARAMS ((int *, function_format_info *, tree)) |
| static void check_format_arg | PARAMS ((void *, tree, unsigned HOST_WIDE_INT)) |
| static void check_format_info_main | PARAMS ((int *, format_check_results *, function_format_info *, const char *, int, tree, unsigned HOST_WIDE_INT)) |
| static void status_warning | PARAMS ((int *, const char *,...)) |
| void | check_function_format (int *status, tree attrs, tree params) |
| static void status_warning | VPARAMS ((int *status, const char *msgid,...)) |
| static void | init_dollar_format_checking (int first_arg_num, tree params) |
| static int | maybe_read_dollar_number (int *status, const char **format, int dollar_needed, tree params, tree *param_ptr, const format_kind_info *fki) |
| static void | finish_dollar_format_checking (int *status, format_check_results *res, int pointer_gap_ok) |
| static const format_flag_spec * | get_flag_spec (format_flag_spec *spec, int flag, const char *predicates) const |
| static void | check_format_info (int *status, function_format_info *info, tree params) |
| static void | check_format_arg (void *ctx, tree format_tree, unsigned HOST_WIDE_INT arg_num) |
| static void | check_format_info_main (int *status, format_check_results *res, function_format_info *info, const char *format_chars, int format_length, tree params, unsigned HOST_WIDE_INT arg_num) |
| static void | check_format_types (int *status, format_wanted_type *types) |
Variables | |
| static const format_length_info | printf_length_specs [] |
| static const format_length_info | scanf_length_specs [] |
| static const format_length_info | strfmon_length_specs [] |
| static const format_flag_spec | printf_flag_specs [] |
| static const format_flag_pair | printf_flag_pairs [] |
| static const format_flag_spec | scanf_flag_specs [] |
| static const format_flag_pair | scanf_flag_pairs [] |
| static const format_flag_spec | strftime_flag_specs [] |
| static const format_flag_pair | strftime_flag_pairs [] |
| static const format_flag_spec | strfmon_flag_specs [] |
| static const format_flag_pair | strfmon_flag_pairs [] |
| static const format_char_info | print_char_table [] |
| static const format_char_info | scan_char_table [] |
| static const format_char_info | time_char_table [] |
| static const format_char_info | monetary_char_table [] |
| static const format_kind_info | format_types [] |
| static char * | dollar_arguments_used = NULL |
| static char * | dollar_arguments_pointer_p = NULL |
| static int | dollar_arguments_alloc = 0 |
| static int | dollar_arguments_count |
| static int | dollar_first_arg_num |
| static int | dollar_max_arg_used |
| static int | dollar_format_warned |
| #define ADJ_STD | ( | VER | ) |
Value:
((int)((VER) == STD_C9L \ ? (warn_long_long ? STD_C99 : STD_C89) \ : (VER)))
Definition at line 343 of file c-format.c.
Referenced by check_format_info_main().
| #define BADLEN { 0, NULL, NULL } |
Definition at line 411 of file c-format.c.
| #define C_STD_NAME | ( | FEATURE_VER | ) |
Value:
(c_language == clk_cplusplus \ ? "ISO C++" \ : ((FEATURE_VER) == STD_EXT \ ? "ISO C" \ : "ISO C90"))
Definition at line 336 of file c-format.c.
Referenced by check_format_info_main(), and maybe_read_dollar_number().
| #define C_STD_VER |
Value:
((int)(c_language == clk_cplusplus \ ? CPLUSPLUS_STD_VER \ : (flag_isoc99 \ ? STD_C99 \ : (flag_isoc94 ? STD_C94 : STD_C89))))
Definition at line 328 of file c-format.c.
Referenced by check_format_info_main().
| #define CPLUSPLUS_STD_VER STD_C94 |
Definition at line 326 of file c-format.c.
| #define NOLENGTHS { BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN } |
Definition at line 412 of file c-format.c.
| #define T89_C { STD_C89, NULL, T_C } |
Definition at line 727 of file c-format.c.
| #define T89_D { STD_C89, NULL, T_D } |
Definition at line 721 of file c-format.c.
| #define T89_F { STD_C89, NULL, T_F } |
Definition at line 718 of file c-format.c.
| #define T89_I { STD_C89, NULL, T_I } |
Definition at line 700 of file c-format.c.
| #define T89_L { STD_C89, NULL, T_L } |
Definition at line 702 of file c-format.c.
| #define T89_LD { STD_C89, NULL, T_LD } |
Definition at line 724 of file c-format.c.
| #define T89_S { STD_C89, NULL, T_S } |
Definition at line 707 of file c-format.c.
| #define T89_UI { STD_C89, NULL, T_UI } |
Definition at line 709 of file c-format.c.
| #define T89_UL { STD_C89, NULL, T_UL } |
Definition at line 711 of file c-format.c.
| #define T89_US { STD_C89, NULL, T_US } |
Definition at line 716 of file c-format.c.
| #define T89_V { STD_C89, NULL, T_V } |
Definition at line 733 of file c-format.c.
| #define T94_W { STD_C94, "wchar_t", T_W } |
Definition at line 735 of file c-format.c.
| #define T94_WI { STD_C94, "wint_t", T_WI } |
Definition at line 738 of file c-format.c.
| #define T99_D { STD_C99, NULL, T_D } |
Definition at line 722 of file c-format.c.
| #define T99_F { STD_C99, NULL, T_F } |
Definition at line 719 of file c-format.c.
| #define T99_IM { STD_C99, "intmax_t", T_IM } |
Definition at line 749 of file c-format.c.
| #define T99_LD { STD_C99, NULL, T_LD } |
Definition at line 725 of file c-format.c.
| #define T99_PD { STD_C99, "ptrdiff_t", T_PD } |
Definition at line 745 of file c-format.c.
| #define T99_SC { STD_C99, NULL, T_SC } |
Definition at line 729 of file c-format.c.
| #define T99_SST { STD_C99, "signed size_t", T_SST } |
Definition at line 743 of file c-format.c.
| #define T99_ST { STD_C99, "size_t", T_ST } |
Definition at line 741 of file c-format.c.
| #define T99_UC { STD_C99, NULL, T_UC } |
Definition at line 731 of file c-format.c.
| #define T99_UIM { STD_C99, "uintmax_t", T_UIM } |
Definition at line 751 of file c-format.c.
| #define T99_UPD { STD_C99, "unsigned ptrdiff_t", T_UPD } |
Definition at line 747 of file c-format.c.
| #define T9L_LL { STD_C9L, NULL, T_LL } |
Definition at line 704 of file c-format.c.
| #define T9L_ULL { STD_C9L, NULL, T_ULL } |
Definition at line 713 of file c-format.c.
| #define T_C &char_type_node |
Definition at line 726 of file c-format.c.
| #define T_D &double_type_node |
Definition at line 720 of file c-format.c.
| #define T_F &float_type_node |
Definition at line 717 of file c-format.c.
| #define T_I &integer_type_node |
Definition at line 699 of file c-format.c.
| #define T_IM &intmax_type_node |
Definition at line 748 of file c-format.c.
| #define T_L &long_integer_type_node |
Definition at line 701 of file c-format.c.
| #define T_LD &long_double_type_node |
Definition at line 723 of file c-format.c.
| #define T_LL &long_long_integer_type_node |
Definition at line 703 of file c-format.c.
| #define T_PD &ptrdiff_type_node |
Definition at line 744 of file c-format.c.
| #define T_S &short_integer_type_node |
Definition at line 706 of file c-format.c.
| #define T_SC &signed_char_type_node |
Definition at line 728 of file c-format.c.
| #define T_SST &signed_size_type_node |
Definition at line 742 of file c-format.c.
| #define T_ST &size_type_node |
Definition at line 740 of file c-format.c.
| #define T_UC &unsigned_char_type_node |
Definition at line 730 of file c-format.c.
| #define T_UI &unsigned_type_node |
Definition at line 708 of file c-format.c.
| #define T_UIM &uintmax_type_node |
Definition at line 750 of file c-format.c.
| #define T_UL &long_unsigned_type_node |
Definition at line 710 of file c-format.c.
| #define T_ULL &long_long_unsigned_type_node |
Definition at line 712 of file c-format.c.
| #define T_UPD &unsigned_ptrdiff_type_node |
Definition at line 746 of file c-format.c.
| #define T_US &short_unsigned_type_node |
Definition at line 715 of file c-format.c.
| #define T_V &void_type_node |
Definition at line 732 of file c-format.c.
| #define T_W &wchar_type_node |
Definition at line 734 of file c-format.c.
| #define T_WI &wint_type_node |
Definition at line 737 of file c-format.c.
| #define TEX_LL { STD_EXT, NULL, T_LL } |
Definition at line 705 of file c-format.c.
| #define TEX_ULL { STD_EXT, NULL, T_ULL } |
Definition at line 714 of file c-format.c.
| #define TEX_W { STD_EXT, "wchar_t", T_W } |
Definition at line 736 of file c-format.c.
| #define TEX_WI { STD_EXT, "wint_t", T_WI } |
Definition at line 739 of file c-format.c.
| anonymous enum |
| FMT_FLAG_ARG_CONVERT | |
| FMT_FLAG_SCANF_A_KLUDGE | |
| FMT_FLAG_FANCY_PERCENT_OK | |
| FMT_FLAG_DOLLAR_MULTIPLE | |
| FMT_FLAG_USE_DOLLAR | |
| FMT_FLAG_ZERO_WIDTH_BAD | |
| FMT_FLAG_EMPTY_PREC_OK | |
| FMT_FLAG_DOLLAR_GAP_POINTER_OK |
Definition at line 348 of file c-format.c.
| enum format_lengths |
Definition at line 299 of file c-format.c.
| enum format_std_version |
| STD_C89 | |
| STD_C94 | |
| STD_C9L | |
| STD_C99 | |
| STD_EXT | |
| STD_C89 | |
| STD_C94 | |
| STD_C9L | |
| STD_C99 | |
| STD_EXT | |
| STD_C89 | |
| STD_C94 | |
| STD_C9L | |
| STD_C99 | |
| STD_EXT | |
| STD_C89 | |
| STD_C94 | |
| STD_C9L | |
| STD_C99 | |
| STD_EXT |
Definition at line 315 of file c-format.c.
| enum format_type |
Definition at line 65 of file c-format.c.
| static void check_format_arg | ( | void * | ctx, | |
| tree | format_tree, | |||
| unsigned HOST_WIDE_INT | arg_num | |||
| ) | [static] |
Definition at line 1391 of file c-format.c.
References abort, array_size, char_type_node, check_format_info_main(), decl_constant_value(), DECL_SIZE_UNIT, function_format_info::first_arg_num, host_integerp(), HOST_WIDE_INT, info, format_check_context::info, integer_zerop(), format_check_results::number_empty, format_check_results::number_extra_args, format_check_results::number_non_literal, format_check_results::number_other, format_check_results::number_unterminated, format_check_results::number_wide, offset, format_check_context::params, format_check_context::res, format_check_context::status, STRIP_NOPS, TREE_CHAIN, TREE_CODE, TREE_INT_CST_LOW, tree_low_cst(), TREE_OPERAND, TREE_STRING_LENGTH, TREE_STRING_POINTER, TREE_TYPE, and TYPE_MAIN_VARIANT.
Referenced by check_format_info().
| static void check_format_info | ( | int * | status, | |
| function_format_info * | info, | |||
| tree | params | |||
| ) | [static] |
Definition at line 1290 of file c-format.c.
References format_wanted_type::arg_num, check_format_arg(), check_function_arguments_recurse(), function_format_info::first_arg_num, format_kind_info::flags, FMT_FLAG_ARG_CONVERT, function_format_info::format_num, function_format_info::format_type, HOST_WIDE_INT, format_check_context::info, format_kind_info::name, format_check_results::number_dollar_extra_args, format_check_results::number_empty, format_check_results::number_extra_args, format_check_results::number_non_literal, format_check_results::number_other, format_check_results::number_unterminated, format_check_results::number_wide, format_check_context::params, format_check_context::res, format_check_context::status, TREE_CHAIN, TREE_VALUE, warn_format_extra_args, warn_format_nonliteral, warn_format_security, and warn_format_zero_length.
Referenced by check_function_format().
| static void check_format_info_main | ( | int * | status, | |
| format_check_results * | res, | |||
| function_format_info * | info, | |||
| const char * | format_chars, | |||
| int | format_length, | |||
| tree | params, | |||
| unsigned HOST_WIDE_INT | arg_num | |||
| ) | [static] |
Definition at line 1550 of file c-format.c.
References _, ADJ_STD, format_wanted_type::arg_num, format_kind_info::bad_flag_pairs, C_STD_NAME, C_STD_VER, format_wanted_type::char_lenient_flag, check_format_types(), format_kind_info::conversion_specs, d, format_length_info::double_index, format_length_info::double_name, format_length_info::double_std, FALSE, finish_dollar_format_checking(), function_format_info::first_arg_num, format_flag_pair::flag_char1, format_kind_info::flag_chars, format_char_info::flag_chars, flag_isoc99, format_kind_info::flag_specs, format_kind_info::flags, format_char_info::flags2, FMT_FLAG_ARG_CONVERT, FMT_FLAG_DOLLAR_GAP_POINTER_OK, FMT_FLAG_EMPTY_PREC_OK, FMT_FLAG_FANCY_PERCENT_OK, FMT_FLAG_SCANF_A_KLUDGE, FMT_FLAG_USE_DOLLAR, FMT_FLAG_ZERO_WIDTH_BAD, FMT_LEN_none, format_char_info::format_chars, function_format_info::format_type, get_flag_spec(), i, format_length_info::index, init_dollar_format_checking(), ISDIGIT, ISGRAPH, format_kind_info::left_precision_char, format_kind_info::length_char_specs, format_kind_info::length_code_char, format_flag_spec::long_name, maybe_read_dollar_number(), format_kind_info::modifier_chars, format_type_detail::name, format_kind_info::name, format_length_info::name, format_flag_spec::name, format_wanted_type::name, format_wanted_type::next, NULL, format_check_results::number_extra_args, format_check_results::number_other, format_wanted_type::param, pedantic, format_wanted_type::pointer_count, format_char_info::pointer_count, format_kind_info::precision_char, format_kind_info::precision_type, format_flag_pair::predicate, format_wanted_type::reading_from_flag, s, format_flag_spec::skip_next_char, format_type_detail::std, format_length_info::std, format_flag_spec::std, format_char_info::std, STD_C89, strchr, strlen(), format_kind_info::suppression_char, TREE_CHAIN, TREE_VALUE, TRUE, format_type_detail::type, format_char_info::types, void_type_node, format_wanted_type::wanted_type, format_wanted_type::wanted_type_name, warn_format_y2k, format_kind_info::width_char, format_kind_info::width_type, and format_wanted_type::writing_in_flag.
Referenced by check_format_arg().
| static void check_format_types | ( | int * | status, | |
| format_wanted_type * | types | |||
| ) | [static] |
Definition at line 2181 of file c-format.c.
References _, abort, format_wanted_type::arg_num, c_common_signed_type(), c_common_unsigned_type(), format_wanted_type::char_lenient_flag, char_type_node, DECL_NAME, DECL_P, error_mark_node, i, IDENTIFIER_POINTER, integer_zerop(), format_wanted_type::name, format_wanted_type::next, format_wanted_type::param, pedantic, format_wanted_type::pointer_count, format_wanted_type::reading_from_flag, signed_char_type_node, strcmp(), STRIP_NOPS, TREE_CODE, TREE_CODE_CLASS, TREE_OPERAND, TREE_READONLY, TREE_TYPE, TREE_UNSIGNED, TYPE_MAIN_VARIANT, TYPE_NAME, TYPE_PRECISION, TYPE_READONLY, TYPE_RESTRICT, TYPE_VOLATILE, unsigned_char_type_node, void_type_node, format_wanted_type::wanted_type, format_wanted_type::wanted_type_name, and format_wanted_type::writing_in_flag.
Referenced by check_format_info_main().
Definition at line 945 of file c-format.c.
References a, args, c, char_type_node, check_format_info(), current_function_decl, DECL_ARGUMENTS, decode_format_attr(), decode_format_type(), function_format_info::first_arg_num, format_kind_info::flags, FMT_FLAG_ARG_CONVERT, function_format_info::format_type, IDENTIFIER_POINTER, info, is_attribute_p(), format_kind_info::name, NULL_TREE, TREE_CHAIN, TREE_CODE, TREE_PURPOSE, TREE_TYPE, TREE_VALUE, TYPE_ATTRIBUTES, TYPE_MAIN_VARIANT, warn_missing_format_attribute, and warning.
Referenced by build_function_call_real(), build_over_call(), check_function_arguments(), and is_valid_printf_arglist().
| static bool decode_format_attr | ( | tree | args, | |
| function_format_info * | info, | |||
| int | validated_p | |||
| ) | [static] |
Definition at line 227 of file c-format.c.
References abort, decode_format_type(), error(), function_format_info::first_arg_num, function_format_info::format_num, function_format_info::format_type, format_type_error, IDENTIFIER_POINTER, p, TREE_CHAIN, TREE_CODE, TREE_INT_CST_HIGH, TREE_INT_CST_LOW, TREE_OPERAND, TREE_VALUE, and warning.
Referenced by check_function_format(), and handle_format_attribute().
| static void finish_dollar_format_checking | ( | int * | status, | |
| format_check_results * | res, | |||
| int | pointer_gap_ok | |||
| ) | [static] |
Definition at line 1221 of file c-format.c.
References i, format_check_results::number_dollar_extra_args, and format_check_results::number_other.
Referenced by check_format_info_main().
| static const format_flag_spec* get_flag_spec | ( | format_flag_spec * | spec, | |
| int | flag, | |||
| const char * | predicates | |||
| ) | const [static] |
Definition at line 1259 of file c-format.c.
References abort, i, NULL, and strchr.
Referenced by check_format_info_main().
Definition at line 153 of file c-format.c.
References ATTR_FLAG_BUILT_IN, char_type_node, error(), HOST_WIDE_INT, NULL_TREE, TREE_CHAIN, TREE_CODE, TREE_INT_CST_HIGH, TREE_INT_CST_LOW, TREE_OPERAND, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and TYPE_MAIN_VARIANT.
Definition at line 83 of file c-format.c.
References ATTR_FLAG_BUILT_IN, char_type_node, decode_format_attr(), error(), function_format_info::first_arg_num, function_format_info::format_num, function_format_info::format_type, HOST_WIDE_INT, info, NULL_TREE, strftime_format_type, TREE_CHAIN, TREE_CODE, TREE_TYPE, TREE_VALUE, TYPE_ARG_TYPES, and TYPE_MAIN_VARIANT.
Definition at line 1052 of file c-format.c.
References free(), i, memset, TREE_CHAIN, TREE_CODE, TREE_TYPE, TREE_VALUE, and xmalloc().
Referenced by check_format_info_main().
| static int maybe_read_dollar_number | ( | int * | status, | |
| const char ** | format, | |||
| int | dollar_needed, | |||
| tree | params, | |||
| tree * | param_ptr, | |||
| const format_kind_info * | fki | |||
| ) | [static] |
Definition at line 1109 of file c-format.c.
References abort, C_STD_NAME, format_kind_info::flags, FMT_FLAG_DOLLAR_MULTIPLE, i, ISDIGIT, memset, format_kind_info::name, pedantic, STD_EXT, TREE_CHAIN, and xrealloc().
Referenced by check_format_info_main().
| static void status_warning PARAMS | ( | (int *, const char *,...) | ) | [static] |
Definition at line 899 of file c-format.c.
References format_type_error, i, strcmp(), strlen(), and strncmp().
| static void check_format_info_main PARAMS | ( | (int *, format_check_results *, function_format_info *, const char *, int, tree, unsigned HOST_WIDE_INT) | ) | [static] |
| static void check_format_info PARAMS | ( | (int *, function_format_info *, tree) | ) | [static] |
| static enum format_type decode_format_type PARAMS | ( | (const char *) | ) | [static] |
Definition at line 635 of file mips-tfile.c.
| static bool decode_format_attr PARAMS | ( | (tree, function_format_info *, int) | ) | [static] |
| void set_Wformat | ( | int | setting | ) |
Definition at line 43 of file c-format.c.
Referenced by c_common_decode_option(), and c_common_handle_option().
Definition at line 1005 of file c-format.c.
References _, diagnostic_set_info(), input_filename, lineno, report_diagnostic, VA_CLOSE, va_end, VA_FIXEDARG, VA_OPEN, and VA_START.
int dollar_arguments_alloc = 0 [static] |
Definition at line 1039 of file c-format.c.
int dollar_arguments_count [static] |
Definition at line 1040 of file c-format.c.
char* dollar_arguments_pointer_p = NULL [static] |
Definition at line 1038 of file c-format.c.
char* dollar_arguments_used = NULL [static] |
Definition at line 1037 of file c-format.c.
int dollar_first_arg_num [static] |
Definition at line 1041 of file c-format.c.
int dollar_format_warned [static] |
Definition at line 1043 of file c-format.c.
int dollar_max_arg_used [static] |
Definition at line 1042 of file c-format.c.
const format_kind_info format_types[] [static] |
Initial value:
{
{ "printf", printf_length_specs, print_char_table, " +#0-'I", NULL,
printf_flag_specs, printf_flag_pairs,
FMT_FLAG_ARG_CONVERT|FMT_FLAG_DOLLAR_MULTIPLE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_EMPTY_PREC_OK,
'w', 0, 'p', 0, 'L',
&integer_type_node, &integer_type_node
},
{ "scanf", scanf_length_specs, scan_char_table, "*'I", NULL,
scanf_flag_specs, scanf_flag_pairs,
FMT_FLAG_ARG_CONVERT|FMT_FLAG_SCANF_A_KLUDGE|FMT_FLAG_USE_DOLLAR|FMT_FLAG_ZERO_WIDTH_BAD|FMT_FLAG_DOLLAR_GAP_POINTER_OK,
'w', 0, 0, '*', 'L',
NULL, NULL
},
{ "strftime", NULL, time_char_table, "_-0^#", "EO",
strftime_flag_specs, strftime_flag_pairs,
FMT_FLAG_FANCY_PERCENT_OK, 'w', 0, 0, 0, 0,
NULL, NULL
},
{ "strfmon", strfmon_length_specs, monetary_char_table, "=^+(!-", NULL,
strfmon_flag_specs, strfmon_flag_pairs,
FMT_FLAG_ARG_CONVERT, 'w', '#', 'p', 0, 'L',
NULL, NULL
}
}
Definition at line 831 of file c-format.c.
const format_char_info monetary_char_table[] [static] |
const format_char_info print_char_table[] [static] |
Initial value:
{
{ "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" },
{ "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" },
{ "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" },
{ "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" },
{ "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" },
{ "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
{ "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" },
{ "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c" },
{ "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" },
{ "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" },
{ "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" },
{ "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
{ "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" },
{ "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
}
Definition at line 753 of file c-format.c.
const format_flag_pair printf_flag_pairs[] [static] |
Initial value:
{
{ ' ', '+', 1, 0 },
{ '0', '-', 1, 0 },
{ '0', 'p', 1, 'i' },
{ 0, 0, 0, 0 }
}
Definition at line 623 of file c-format.c.
const format_flag_spec printf_flag_specs[] [static] |
Initial value:
{
{ ' ', 0, 0, N_("` ' flag"), N_("the ` ' printf flag"), STD_C89 },
{ '+', 0, 0, N_("`+' flag"), N_("the `+' printf flag"), STD_C89 },
{ '#', 0, 0, N_("`#' flag"), N_("the `#' printf flag"), STD_C89 },
{ '0', 0, 0, N_("`0' flag"), N_("the `0' printf flag"), STD_C89 },
{ '-', 0, 0, N_("`-' flag"), N_("the `-' printf flag"), STD_C89 },
{ '\'', 0, 0, N_("`'' flag"), N_("the `'' printf flag"), STD_EXT },
{ 'I', 0, 0, N_("`I' flag"), N_("the `I' printf flag"), STD_EXT },
{ 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 },
{ 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 },
{ 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 },
{ 0, 0, 0, NULL, NULL, 0 }
}
Definition at line 607 of file c-format.c.
const format_length_info printf_length_specs[] [static] |
Initial value:
{
{ "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 },
{ "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L },
{ "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 },
{ "L", FMT_LEN_L, STD_C89, NULL, 0, 0 },
{ "z", FMT_LEN_z, STD_C99, NULL, 0, 0 },
{ "Z", FMT_LEN_z, STD_EXT, NULL, 0, 0 },
{ "t", FMT_LEN_t, STD_C99, NULL, 0, 0 },
{ "j", FMT_LEN_j, STD_C99, NULL, 0, 0 },
{ NULL, 0, 0, NULL, 0, 0 }
}
Definition at line 570 of file c-format.c.
const format_char_info scan_char_table[] [static] |
Initial value:
{
{ "di", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "*w'I", "W" },
{ "u", 1, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "*w'I", "W" },
{ "oxX", 1, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "*w", "W" },
{ "efgEG", 1, STD_C89, { T89_F, BADLEN, BADLEN, T89_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "*w'", "W" },
{ "c", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "cW" },
{ "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "cW" },
{ "[", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "cW[" },
{ "p", 2, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W" },
{ "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" },
{ "FaA", 1, STD_C99, { T99_F, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "*w'", "W" },
{ "C", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*w", "W" },
{ "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "*aw", "W" },
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
}
Definition at line 776 of file c-format.c.
const format_flag_pair scanf_flag_pairs[] [static] |
const format_flag_spec scanf_flag_specs[] [static] |
Initial value:
{
{ '*', 0, 0, N_("assignment suppression"), N_("the assignment suppression scanf feature"), STD_C89 },
{ 'a', 0, 0, N_("`a' flag"), N_("the `a' scanf flag"), STD_EXT },
{ 'w', 0, 0, N_("field width"), N_("field width in scanf format"), STD_C89 },
{ 'L', 0, 0, N_("length modifier"), N_("length modifier in scanf format"), STD_C89 },
{ '\'', 0, 0, N_("`'' flag"), N_("the `'' scanf flag"), STD_EXT },
{ 'I', 0, 0, N_("`I' flag"), N_("the `I' scanf flag"), STD_EXT },
{ 0, 0, 0, NULL, NULL, 0 }
}
Definition at line 632 of file c-format.c.
const format_length_info scanf_length_specs[] [static] |
Initial value:
{
{ "h", FMT_LEN_h, STD_C89, "hh", FMT_LEN_hh, STD_C99 },
{ "l", FMT_LEN_l, STD_C89, "ll", FMT_LEN_ll, STD_C9L },
{ "q", FMT_LEN_ll, STD_EXT, NULL, 0, 0 },
{ "L", FMT_LEN_L, STD_C89, NULL, 0, 0 },
{ "z", FMT_LEN_z, STD_C99, NULL, 0, 0 },
{ "t", FMT_LEN_t, STD_C99, NULL, 0, 0 },
{ "j", FMT_LEN_j, STD_C99, NULL, 0, 0 },
{ NULL, 0, 0, NULL, 0, 0 }
}
Definition at line 585 of file c-format.c.
const format_flag_pair strfmon_flag_pairs[] [static] |
const format_flag_spec strfmon_flag_specs[] [static] |
Initial value:
{
{ '=', 0, 1, N_("fill character"), N_("fill character in strfmon format"), STD_C89 },
{ '^', 0, 0, N_("`^' flag"), N_("the `^' strfmon flag"), STD_C89 },
{ '+', 0, 0, N_("`+' flag"), N_("the `+' strfmon flag"), STD_C89 },
{ '(', 0, 0, N_("`(' flag"), N_("the `(' strfmon flag"), STD_C89 },
{ '!', 0, 0, N_("`!' flag"), N_("the `!' strfmon flag"), STD_C89 },
{ '-', 0, 0, N_("`-' flag"), N_("the `-' strfmon flag"), STD_C89 },
{ 'w', 0, 0, N_("field width"), N_("field width in strfmon format"), STD_C89 },
{ '#', 0, 0, N_("left precision"), N_("left precision in strfmon format"), STD_C89 },
{ 'p', 0, 0, N_("right precision"), N_("right precision in strfmon format"), STD_C89 },
{ 'L', 0, 0, N_("length modifier"), N_("length modifier in strfmon format"), STD_C89 },
{ 0, 0, 0, NULL, NULL, 0 }
}
Definition at line 677 of file c-format.c.
const format_length_info strfmon_length_specs[] [static] |
const format_flag_pair strftime_flag_pairs[] [static] |
Initial value:
{
{ 'E', 'O', 0, 0 },
{ '_', '-', 0, 0 },
{ '_', '0', 0, 0 },
{ '-', '0', 0, 0 },
{ '^', '#', 0, 0 },
{ 0, 0, 0, 0 }
}
Definition at line 666 of file c-format.c.
const format_flag_spec strftime_flag_specs[] [static] |
Initial value:
{
{ '_', 0, 0, N_("`_' flag"), N_("the `_' strftime flag"), STD_EXT },
{ '-', 0, 0, N_("`-' flag"), N_("the `-' strftime flag"), STD_EXT },
{ '0', 0, 0, N_("`0' flag"), N_("the `0' strftime flag"), STD_EXT },
{ '^', 0, 0, N_("`^' flag"), N_("the `^' strftime flag"), STD_EXT },
{ '#', 0, 0, N_("`#' flag"), N_("the `#' strftime flag"), STD_EXT },
{ 'w', 0, 0, N_("field width"), N_("field width in strftime format"), STD_EXT },
{ 'E', 0, 0, N_("`E' modifier"), N_("the `E' strftime modifier"), STD_C99 },
{ 'O', 0, 0, N_("`O' modifier"), N_("the `O' strftime modifier"), STD_C99 },
{ 'O', 'o', 0, NULL, N_("the `O' modifier"), STD_EXT },
{ 0, 0, 0, NULL, NULL, 0 }
}
Definition at line 651 of file c-format.c.
const format_char_info time_char_table[] [static] |
Initial value:
{
{ "ABZab", 0, STD_C89, NOLENGTHS, "^#", "" },
{ "cx", 0, STD_C89, NOLENGTHS, "E", "3" },
{ "HIMSUWdmw", 0, STD_C89, NOLENGTHS, "-_0Ow", "" },
{ "j", 0, STD_C89, NOLENGTHS, "-_0Ow", "o" },
{ "p", 0, STD_C89, NOLENGTHS, "#", "" },
{ "X", 0, STD_C89, NOLENGTHS, "E", "" },
{ "y", 0, STD_C89, NOLENGTHS, "EO-_0w", "4" },
{ "Y", 0, STD_C89, NOLENGTHS, "-_0EOw", "o" },
{ "%", 0, STD_C89, NOLENGTHS, "", "" },
{ "C", 0, STD_C99, NOLENGTHS, "-_0EOw", "o" },
{ "D", 0, STD_C99, NOLENGTHS, "", "2" },
{ "eVu", 0, STD_C99, NOLENGTHS, "-_0Ow", "" },
{ "FRTnrt", 0, STD_C99, NOLENGTHS, "", "" },
{ "g", 0, STD_C99, NOLENGTHS, "O-_0w", "2o" },
{ "G", 0, STD_C99, NOLENGTHS, "-_0Ow", "o" },
{ "h", 0, STD_C99, NOLENGTHS, "^#", "" },
{ "z", 0, STD_C99, NOLENGTHS, "O", "o" },
{ "kls", 0, STD_EXT, NOLENGTHS, "-_0Ow", "" },
{ "P", 0, STD_EXT, NOLENGTHS, "", "" },
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
}
Definition at line 796 of file c-format.c.
1.5.6