[cfe-dev] Is function pointer and void * incompatible?

Sanghyeon Seo sanxiyn at gmail.com
Tue Dec 25 19:56:23 PST 2007


The following code warns on clang, but does not warn on GCC.

typedef int unary_int_func(int arg);
unary_int_func *func;

void set_func(void *p) {
  func = p;
}

test.c:5:8: warning: incompatible pointer types assigning 'void *' to
'unary_int_func *'

-- 
Seo Sanghyeon



More information about the cfe-dev mailing list