summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/Wpointer-to-int-cast-3.c
blob: c82ca5cf5fbc8efb26fec79200c2f68999ef7bac (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 "cast to pointer from integer of different size" } */
}