[cfe-dev] Assigning NULL

Sanghyeon Seo sanxiyn at gmail.com
Tue Nov 13 18:21:21 PST 2007


The following is a typical pattern in many C programs.

#include <stddef.h>

typedef void (*hookfunc)(void *arg);
hookfunc hook;

void clear_hook() {
  hook = NULL;
}

Should this warn?
test.c:7:8: warning: incompatible pointer types assigning 'void *' to 'hookfunc'

-- 
Seo Sanghyeon



More information about the cfe-dev mailing list