Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!ncar!groucho!steve From: steve@groucho.ucar.edu (Steve Emmerson) Newsgroups: comp.lang.c Subject: Re: is (int (*)())NULL legal when NULL is (void *)0? Message-ID: <9208@ncar.ucar.edu> Date: 18 Nov 90 02:51:49 GMT References: <14484@smoke.brl.mil> <14498@smoke.brl.mil> <27780@mimsy.umd.edu> <14517@smoke.brl.mil> Sender: news@ncar.ucar.edu Organization: University Corporation for Atmospheric Research (UCAR) Lines: 26 In <14517@smoke.brl.mil> gwyn@smoke.brl.mil (Doug Gwyn) writes: >In article <27780@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: >>This would make it difficult to pass a `nil pointer to function of no >>arguments returning int' to a function for which no prototype can be >>provided. >But not impossible, as a suitable pointer variable initialized to a null >pointer (trivially accomplished) could be used. You could even define >it to be const-qualified and hope the compiler is good at optimizations. Whoa! So the following is non-conforming: foo((int((*)(void)))NULL) where the prototype for foo() isn't in scope and it takes the indicated argument type. This has implications for those of us who, at least, *try* to write portable code (though, as Doug indicated, the problem is avoidable). Are you sure of this, Doug? Or do we need an Official Ruling? I know. When in doubt, request a ruling ;-). Steve Emmerson steve@unidata.ucar.edu ...!ncar!unidata!steve