https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81980

--- Comment #4 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
With -m32 on ix86 we hit:

9282    static tree
9283    ix86_build_builtin_va_list (void)
9284    {
9285      if (TARGET_64BIT)
....
9318      else
9319        {
9320          /* For i386 we use plain pointer to argument area.  */
9321          return build_pointer_type (char_type_node);

and so __builtin_va_list and thus va_list is "char *".

Then, in c-format.c:check_function_format

1147                      /* Check if the current function has a parameter to
which
1148                         the format attribute could be attached; if not, it
1149                         can't be a candidate for a format attribute,
despite
1150                         the vprintf-like or vscanf-like call.  */
1151                      tree args;
1152                      for (args = DECL_ARGUMENTS (current_function_decl);
1153                           args != 0;
1154                           args = DECL_CHAIN (args))
1155                        {
1156                          if (TREE_CODE (TREE_TYPE (args)) == POINTER_TYPE
1157                              && (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE
(args)))
1158                                  == char_type_node))
1159                            break;
1160                        }
1161                      if (args != 0)

with -m32, the "va_list ap" is "char *" and thus matches the test at lines
1156-1158;
without -m32 it doesn't.

Reply via email to