Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ncar!groucho!steve From: steve@groucho.ucar.edu (Steve Emmerson) Newsgroups: comp.std.c Subject: Re: gcc and NULL function pointers. Message-ID: <11774@ncar.ucar.edu> Date: 11 Jun 91 02:07:34 GMT References: <4641@inews.intel.com> <1991Jun10.061202.25199@kithrup.COM> <1991Jun10.073125.25120@tkou02.enet.dec.com> <1991Jun10.081924.26439@kithrup.COM> Sender: news@ncar.ucar.edu Organization: University Corporation for Atmospheric Research (UCAR) Lines: 17 In <1991Jun10.081924.26439@kithrup.COM> sef@kithrup.COM (Sean Eric Fagan) writes: >ANSI does not require a prototype for non-variardic functions (as far as I >can tell). As a result, for a certain class of popular machines, under >certain compiler options, defining NULL as 0 will be incorrect, while >'(void*)0' is correct. >And the program that would core-dump on this would be perfectly correct, >according to ANSI. The header file would, therefore, be wrong. No. Since the program didn't cast the macro NULL into the appropriate type, it's relying on implementation-defined (or is it undefined?) behavior; hence, the program isn't strictly conforming ("correct" in your terminology). Steve Emmerson steve@unidata.ucar.edu ...!ncar!unidata!steve