Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!udel!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: prototypes, NULL, and magic Message-ID: <15676@smoke.brl.mil> Date: 2 Apr 91 22:06:27 GMT References: <1490@sheol.UUCP> <15588@smoke.brl.mil> <1561@sheol.UUCP> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 14 In article <1561@sheol.UUCP> throopw@sheol.UUCP (Wayne Throop) writes: >So, specifically: under the upcoming BSD release, with prototypes in >scope, is it really safe to use unadorned NULL to terminate a >variable argument list a-la execl(2) family as Chris seemed to >imply (but did not explicitly state)? Or did I misunderstand? No, that would depend on the implementation. If NULL is defined as 0 (which is always allowed for a standard-conforming implementation), there could easily be a problem. The prototype does not specify the types of the ,... arguments, so no automatic argument conversion will be done for them. If NULL is defined as ((void*)0), for example, then it should work, only because void* and char* are required to have the same representation (so if a char* is expected, a void* can be passed for the actual argument).