Small ChangeLog tweak.
[official-gcc.git] / gcc / testsuite / gcc.dg / format / attr-6.c
blob211ee0087be479d99a974b0e7e3b6a48338ad321
1 /* Test for format attributes: test default attributes are applied
2 to implicit declarations. */
3 /* Origin: Joseph Myers <jsm28@cam.ac.uk> */
4 /* { dg-do compile } */
5 /* { dg-options "-std=gnu89 -Wformat" } */
7 /* We can't #include "format.h" here. */
9 /* Technically, none of the format functions should be implicitly declared;
10 either the implicit type is wrong, the function has variable arguments
11 or it requires a type declared in a header. However, some bad programming
12 practice uses implicit declarations of some of these functions.
14 Note that printf is not used in this test because of the declaration
15 of it as a built-in function. */
17 void
18 foo (const char *s, int *p)
20 scanf("%ld", p); /* { dg-warning "12:format" "implicit scanf" } */
21 /* { dg-warning "implicit" "implicit decl warning" { target *-*-* } .-1 } */