Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!asuvax!ncar!news.miami.edu!umiami!bxpfac From: bxpfac@umiami.ir.miami.edu Newsgroups: comp.lang.c Subject: Is there a NULL pointer to functions? Message-ID: <1991May21.125639.10052@umiami.ir.miami.edu> Date: 21 May 91 16:56:39 GMT Reply-To: devebw9f@miavax.ir.miami.edu Distribution: na Organization: Univ of Miami IR Lines: 20 As the subject heading says, is there a NULL pointer to functions? The program shown below when compiled with gcc generated the following message: In function foo: warning: ANSI C forbids comparison of `void *' with function pointer /*-- Program --*/ #define NULL ((void *) 0) void foo (void (*fun) (void)) { if (fun != NULL) /* Line with the warning. */ fun (); } Thanks for any suggestions to fix this. Bimal / devebw9f@miavax.ir.miami.edu