summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-3.c
blob: 12bfd4284d47f4b9157240cbcdcf4d2d8025033c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* Test -Wno-pointer-to-int-cast.  */
/* Origin: Joseph Myers <joseph@codesourcery.com> */
/* { dg-do compile } */
/* { dg-options "-Wno-pointer-to-int-cast" } */

void *p;

char
f (void)
{
  return (char) p;
}


char c;

void *
g (void)
{
  return (void *) c; /* { dg-warning "warning: cast to pointer from integer of different size" } */
}