Merge branches/gcc-4_8-branch rev 208968.
[official-gcc.git] / gcc-4_8-branch / gcc / testsuite / c-c++-common / Wint-to-pointer-cast-3.c
blob052ab3727fca20fb627d1e246617c8edeff460d5
1 /* Test -Wno-int-to-pointer-cast. */
2 /* Origin: Joseph Myers <joseph@codesourcery.com> */
3 /* { dg-do compile } */
4 /* { dg-options "-Wno-int-to-pointer-cast" } */
6 char c;
8 void *
9 f (void)
11 return (void *) c;
14 void *p;
16 char
17 g (void)
19 return (char) p;
20 /* { dg-warning "cast from pointer to integer of different size" "" { target c } 19 } */
21 /* { dg-error "cast from 'void\\*' to 'char' loses precision" "" { target c++ } 19 } */