PR c/89525
* c-typeck.c (convert_arguments): Call inform_declaration only if
the previous warning_at call returned true.
* gcc.dg/pr89525.c: New test.
From-SVN: r269274
+2019-02-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/89525
+ * c-typeck.c (convert_arguments): Call inform_declaration only if
+ the previous warning_at call returned true.
+
2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
* c-parser.c (c_parser_oacc_shape_clause): Add loc formal
2019-02-22 Thomas Schwinge <thomas@codesourcery.com>
* c-parser.c (c_parser_oacc_shape_clause): Add loc formal
if (builtin_type == void_type_node)
{
if (builtin_type == void_type_node)
{
- warning_at (loc, OPT_Wbuiltin_declaration_mismatch,
- "too many arguments to built-in function %qE "
- "expecting %d",
- function, parmnum);
-
- inform_declaration (fundecl);
+ if (warning_at (loc, OPT_Wbuiltin_declaration_mismatch,
+ "too many arguments to built-in function %qE "
+ "expecting %d", function, parmnum))
+ inform_declaration (fundecl);
builtin_typetail = NULL_TREE;
}
builtin_typetail = NULL_TREE;
}
for (tree t = builtin_typetail; t; t = TREE_CHAIN (t))
++nargs;
for (tree t = builtin_typetail; t; t = TREE_CHAIN (t))
++nargs;
- warning_at (loc, OPT_Wbuiltin_declaration_mismatch,
- "too few arguments to built-in function %qE expecting %u",
- function, nargs - 1);
- inform_declaration (fundecl);
+ if (warning_at (loc, OPT_Wbuiltin_declaration_mismatch,
+ "too few arguments to built-in function %qE "
+ "expecting %u", function, nargs - 1))
+ inform_declaration (fundecl);
}
return error_args ? -1 : (int) parmnum;
}
return error_args ? -1 : (int) parmnum;
2019-02-28 Jakub Jelinek <jakub@redhat.com>
2019-02-28 Jakub Jelinek <jakub@redhat.com>
+ PR c/89525
+ * gcc.dg/pr89525.c: New test.
+
PR c/89520
* gcc.dg/pr89520-1.c: New test.
* gcc.dg/pr89520-2.c: New test.
PR c/89520
* gcc.dg/pr89520-1.c: New test.
* gcc.dg/pr89520-2.c: New test.
--- /dev/null
+/* PR c/89525 */
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+double sqrt (); /* { dg-bogus "declared here" } */
+
+void
+foo (void)
+{
+ sqrt ();
+}