This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to add option -Wmissing-format-attribute


On Fri, Sep 29, 2000 at 11:46:45PM +0100, Joseph S. Myers wrote:
> +	  if (warn_missing_format_attribute && info->first_arg_num == 0
> +	      && info->format_type != strftime_format_type)
> +	    {
> +	      function_format_info *info2;
> +	      for (info2 = function_format_list; info2; info2 = info2->next)
> +		if ((info2->assembler_name
> +		     ? (info2->assembler_name == DECL_ASSEMBLER_NAME (current_function_decl))
> +		     : (info2->name == DECL_NAME (current_function_decl)))
> +		    && info2->format_type == info->format_type)
> +		  break;
> +	      if (info2 == NULL)
> +		warning ("function might be possible candidate for `%s' format attribute",
> +			 format_types[info->format_type].name);
> +	    }

Seems like you should also check that the current function
is varargs.  Otherwise chances are that the va_list came
from somewhere else.


r~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]