+2018-01-29 Marek Polacek <polacek@redhat.com>
+
+ PR c/83966
+ * c-format.c (check_function_format): Check current_function_decl.
+
2018-01-27 Jakub Jelinek <jakub@redhat.com>
* c-cppbuiltin.c (c_cpp_builtins): Use ggc_strdup for the fp_suffix
from the format attribute if the called function is decorated
with it. Avoid using calls with string literal formats for
guidance since those are unlikely to be viable candidates. */
- if (warn_suggest_attribute_format && info.first_arg_num == 0
+ if (warn_suggest_attribute_format
+ && current_function_decl != NULL_TREE
+ && info.first_arg_num == 0
&& (format_types[info.format_type].flags
& (int) FMT_FLAG_ARG_CONVERT)
/* c_strlen will fail for a function parameter but succeed
+2018-01-29 Marek Polacek <polacek@redhat.com>
+
+ PR c/83966
+ * gcc.dg/format/Wsuggest-attribute-1.c: New test.
+
2018-01-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/84057
--- /dev/null
+/* PR c/83966 */
+/* { dg-do compile } */
+/* { dg-options "-Wsuggest-attribute=format" } */
+
+#include "format.h"
+
+va_list va;
+const char *f;
+__typeof (vsnprintf ("foo", 0U, f, va)) T;