Merge from mainline
[official-gcc.git] / gcc / testsuite / gcc.dg / cast-4.c
blob32b02cb3a88bb1733f14fadfa7dd3803b0c0a77d
1 /* Test warnings when casting from a constant integer to pointer.
2 Test with -pedantic-errors. */
3 /* Origin: Carlos O'Donell <carlos@codesourcery.com> */
4 /* { dg-do compile } */
5 /* { dg-options "-std=gnu99 -pedantic-errors" } */
7 extern int i;
8 char c;
9 void
10 f (void)
12 c = (char)&i; /* { dg-warning "warning: cast from pointer to integer of different size" } */