PR target/83368
[official-gcc.git] / gcc / testsuite / c-c++-common / Wint-to-pointer-cast-3.c
blob8df4e1fa4ae83e6a0269e4048e0ad5090b199ab4
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 } .-1 } */
21 /* { dg-error "cast from 'void\\*' to 'char' loses precision" "" { target c++ } .-2 } */