Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!elroy.jpl.nasa.gov!ames!dftsrv!mimsy!chris From: chris@mimsy.umd.edu (Chris Torek) Newsgroups: comp.lang.c Subject: Re: void * compatibility Keywords: C void types Message-ID: <26628@mimsy.umd.edu> Date: 20 Sep 90 01:19:00 GMT References: <8770@b11.ingr.com> Distribution: usa Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 17 In article <8770@b11.ingr.com> polfer@b11.ingr.com (? Polfer) writes: >... "Type `void *' is not assignment compatible with type `int (*)()'." >The compiler is not in full ANSI mode ... [and] Metaware High C >defines NULL in stdio.h as "(void *)0". The value ((void *)0) is a generic nil pointer, as well as being a particular specific nil pointer, and any compiler that believes it is not suitable in an (int (*)()) context is buggy (at least if the compiler claims ANSI conformance). Personally, I think defining NULL as (void *)0 is foolishness: if you want your compiler to provide complete error checking, you should define it as `__nil' and make __nil a keyword. Using (void *)0 fixes a few specific problems, but leaves others unfixed and unfixable. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 405 2750) Domain: chris@cs.umd.edu Path: uunet!mimsy!chris