1 /* { dg-options "-fno-short-enums" } */
2 /* { dg-additional-options "-Wno-return-type" } */
7 _sch_isxdigit = 0x0100,
11 _sch_isalnum = _sch_isidst | _sch_isdigit,
12 _sch_iscppsp = _sch_isvsp | _sch_isnvsp,
14 extern const unsigned short _sch_istable[256];
15 typedef union tree_node *tree;
16 typedef const union tree_node *const_tree;
19 OPT_Warray_bounds = 240,
21 OPT_Wintf_annotation = 368,
22 OPT_std_gnu__14 = 1311,
35 enum tree_node_structure_enum
40 enum integer_type_kind
47 enum tree_code code:16;
61 struct tree_type_common
67 struct tree_base base;
68 struct tree_typed typed;
69 struct tree_common common;
70 struct tree_type_common type_common;
71 struct tree_list list;
73 extern unsigned char tree_contains_struct[MAX_TREE_CODES][64];
74 extern tree integer_types[itk_none];
75 extern void tree_contains_struct_check_failed (const_tree,
76 tree_node_structure_enum,
79 __attribute__ ((__noreturn__));
81 tree_check (tree __t, const char *__f, int __l, const char *__g,
87 contains_struct_check (const_tree __t,
88 const enum tree_node_structure_enum __s,
89 const char *__f, int __l, const char *__g)
91 if (tree_contains_struct[((enum tree_code) (__t)->base.code)][__s] != 1)
92 tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
96 tree_class_check (const_tree __t, const enum tree_code_class __class,
97 const char *__f, int __l, const char *__g)
102 is_attribute_p (const char *attr_name, const_tree ident)
106 extern int integer_zerop (const_tree);
107 extern bool warning (int, const char *, ...)
108 __attribute__ ((__nonnull__ (2)));
110 check_function_arguments_recurse (void (*)(void *, tree, unsigned long long),
111 void *, tree, unsigned long long);
112 extern bool objc_string_ref_type_p (tree);
115 FMT_FLAG_SCANF_A_KLUDGE = 2,
116 FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL = 256
128 typedef struct alloc_pool_list_def
134 bool (*string_object_ref_type_p) (const_tree stringref);
137 extern struct gcc_targetcm targetcm;
140 gcc_objc_string_format_type,
142 typedef struct function_format_info
146 function_format_info;
147 static const format_kind_info format_types_orig[] = { };
148 struct format_check_context { };
150 static const format_kind_info *format_types = format_types_orig;
151 static void check_format_info (function_format_info *, tree);
152 void check_format_arg (void *, tree, unsigned long long);
155 check_function_format (tree attrs, int nargs, tree * argarray)
160 ((contains_struct_check
161 ((a), (TS_COMMON), "../../git-master/gcc/c-family/c-format.c", 1002,
162 __FUNCTION__))->common.chain))
167 ((a), "../../git-master/gcc/c-family/c-format.c", 1004,
168 __FUNCTION__, (TREE_LIST)))->list.purpose)))
170 function_format_info info;
172 tree params = (tree) __null;
173 check_format_info (&info, params);
180 avoid_dollar_number (const char *format)
182 while ((_sch_istable[(*format) & 0xff] & (unsigned short) (_sch_isdigit)))
186 warning (OPT_Wformat_,
187 "$ operand number used after format without operand number");
192 check_format_info (function_format_info * info, tree params)
194 format_check_context format_ctx;
195 unsigned long long arg_num;
197 check_function_arguments_recurse (check_format_arg, &format_ctx,
198 format_tree, arg_num);
199 const char *format_chars;
200 if (integer_zerop (format_tree))
203 ((contains_struct_check
204 ((params), (TS_COMMON),
205 "../../git-master/gcc/c-family/c-format.c", 1444,
206 __FUNCTION__))->common.chain);
210 if (((enum tree_code) (format_tree)->base.code) != ADDR_EXPR)
214 if (format_types[info->format_type].flags & (int)
215 FMT_FLAG_PARSE_ARG_CONVERT_EXTERNAL)
217 bool objc_str = (info->format_type == gcc_objc_string_format_type);
218 if (((enum tree_code) (format_tree)->base.code) != CONST_DECL
222 objc_string_ref_type_p (((contains_struct_check
223 ((format_tree), (TS_TYPED),
224 "../../git-master/gcc/c-family/c-format.c",
225 1498, __FUNCTION__))->typed.type)))
227 (*targetcm.string_object_ref_type_p) ((const_tree)
228 ((contains_struct_check
231 "../../git-master/gcc/c-family/c-format.c",
233 __FUNCTION__))->typed.
240 if (((tree_class_check
241 ((((contains_struct_check
242 ((((contains_struct_check
243 ((format_tree), (TS_TYPED),
244 "../../git-master/gcc/c-family/c-format.c", 1549,
245 __FUNCTION__))->typed.type)), (TS_TYPED),
246 "../../git-master/gcc/c-family/c-format.c", 1549,
247 __FUNCTION__))->typed.type)), (tcc_type),
248 "../../git-master/gcc/c-family/c-format.c", 1549,
249 __FUNCTION__))->type_common.main_variant) != integer_types[itk_char])
255 const format_kind_info *fki = &format_types[info->format_type];
256 while (*format_chars != 0)
259 if (fki->width_type != __null && *format_chars == '*')
262 if (avoid_dollar_number (format_chars))
263 if (avoid_dollar_number (format_chars))