Take a stab at recognising %b formats.

This commit is contained in:
pk 1996-03-17 03:13:17 +00:00
parent bf834e7def
commit 1e66a8828f
1 changed files with 26 additions and 0 deletions

View File

@ -709,6 +709,7 @@ static format_char_info print_char_table[] = {
{ "S", 1, T_W, NULL, NULL, NULL, NULL, "-wp" },
{ "p", 1, T_V, NULL, NULL, NULL, NULL, "-w" },
{ "n", 1, T_I, T_S, T_L, T_LL, NULL, "" },
{ "b", 0, T_I, NULL, NULL, NULL, NULL, "" },
{ NULL }
};
@ -1021,6 +1022,31 @@ check_format_info (info, params)
}
}
}
else
if (*format_chars == 'b') {
if (params == 0)
{
warning (tfaff);
return;
}
if (info->first_arg_num != 0)
{
cur_param = TREE_VALUE (params);
cur_type = TREE_TYPE (cur_param);
params = TREE_CHAIN (params);
++arg_num;
if (TREE_CODE (cur_type) != POINTER_TYPE ||
(TYPE_MAIN_VARIANT (TREE_TYPE (cur_type)) != char_type_node))
{
sprintf (message, "%s format, %s arg (arg %d)",
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (char_type_node))),
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (cur_type))),
arg_num);
warning (message);
}
cur_type = TREE_TYPE (cur_type);
}
}
else
{
while (isdigit (*format_chars))