blob: 2ba74a3b4c10d5dfd096f23ce2edbad526b5edf2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* Test for multiple declarations and composite types, with built-in
functions. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-std=c89 -Wformat -g" } */
void
f (void)
{
int printf;
int strcmp;
{
int printf (const char *, ...);
int strcmp ();
/* Should get format warnings even though the built-in declaration
isn't "visible". */
printf (
"%s", 1); /* { dg-warning "8:format" } */
/* The type of strcmp here should have no prototype. */
if (0)
strcmp (1);
/* Likewise, implicitly declared memcmp. */
if (0)
memcmp (1);
}
}
/* Should still diagnose incompatible prototype for strcmp. */
int strcmp (void); /* { dg-error "conflict" } */
|