Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site zeus.UUCP Path: utzoo!linus!decvax!tektronix!teklds!zeus!keithr From: keithr@zeus.UUCP (Keith Rule) Newsgroups: net.lang.c Subject: Shouldn't this work? Message-ID: <347@zeus.UUCP> Date: Thu, 16-Aug-84 16:50:31 EDT Article-I.D.: zeus.347 Posted: Thu Aug 16 16:50:31 1984 Date-Received: Sat, 25-Aug-84 02:57:53 EDT Organization: Tektronix, Beaverton OR Lines: 42 [bug food] The following program fragment demonstates a problem with "void". I wish to build a jump table to "void" functions, however this program fragment, which defines the jump table, doesn't compile. If I replace all the "void"s with "int"s the fragment compiles without any problems. 1 #include 2 3 typedef struct Builtin { 4 char *name; 5 void (*func)(); 6 } BUILTIN; 7 8 extern void beep(); 9 10 BUILTIN builtins[] = { 11 {"beep", beep}, 12 {(char *) NULL, (void (*)()) NULL} 13 }; Output from lint. The C complier also produces the first error message. tmp.c: tmp.c(11): operands of = have incompatible types tmp.c(11): illegal initialization builtins defined( tmp.c(10) ), but never used Would someone please tell me what I'm doing wrong. I'm stumped. Thanks in Advance, Keith Rule tektronix!teklds!keithr