home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.std.c
- Path: sparky!uunet!haven.umd.edu!decuac!pa.dec.com!engage.pko.dec.com!e2big.mko.dec.com!nntpd.lkg.dec.com!jit533.jit.dec.com!diamond
- From: diamond@jit533.jit.dec.com (Norman Diamond)
- Subject: Re: Null pointer constant compatible with pointer to funtion ?
- Message-ID: <1993Jan21.061433.29672@nntpd.lkg.dec.com>
- Keywords: pointer
- Sender: usenet@nntpd.lkg.dec.com (USENET News System)
- Reply-To: diamond@jit.dec.com (Norman Diamond)
- Organization: Digital Equipment Corporation Japan , Tokyo
- References: <1993Jan21.001622.13452@xilinx.com>
- Date: Thu, 21 Jan 1993 06:14:33 GMT
- Lines: 21
-
- In article <1993Jan21.001622.13452@xilinx.com> lou@xilinx.com (Lou Sanchez-Chopitea) writes:
- > Is a null pointer constant (3.2.2.3) (and therefore NULL (4.1.5))
- >assignment compatible with a pointer to function ?
- >standard conforming ?
- > #include <stddef.h>
- > void (*g)( void);
- > g = NULL;
-
- Yes. Null pointer constants specifically have this magic property.
- 3.2.2.3, 3.3.16.1, 3.3.9, and 3.3.15 all define capabilities for
- null pointer constants in relation to all kinds of pointers.
-
- In other contexts, a null pointer constant reverts to being a simple
- integer constant which happens to be 0, or a constant (void *) pointer
- to objects which happens to be a null pointer (depending on which kind of
- expression you coded, or which way the implementation defines NULL).
- Those would be different, not compatible with pointers to functions.
- --
- Norman Diamond diamond@jit.dec.com
- If this were the company's opinion, I wouldn't be allowed to post it.
- Pardon me? Or do I have to commit a crime first?
-