function-ptr.c 398 B

1234567891011
  1. // RUN: %clang_cc1 %s -verify -pedantic
  2. typedef int unary_int_func(int arg);
  3. unary_int_func *func;
  4. unary_int_func *set_func(void *p) {
  5. func = p; // expected-warning {{converts between void pointer and function pointer}}
  6. p = func; // expected-warning {{converts between void pointer and function pointer}}
  7. return p; // expected-warning {{converts between void pointer and function pointer}}
  8. }