🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2486

int (*f)(void) = 0; int (*f)(void) = (void *) 0;

#2486
From: Earl Chew
Date: Tue, 26 Feb 1991 21:39
16 lines
974 bytes
The standard states that 0 and (void *) 0 are `null pointers'. Does this mean
that they are equivalent in all contexts? Specifically:

int (*f)(void) = 0;

My understanding is that this is permissible.

int (*f)(void) = (void *) 0;

I am unsure whether this is permissible.

Earl
--
Earl Chew, Dept of Computer Science, Monash University, Australia 3168
EMAIL: cechew@bruce.cs.monash.edu.au PHONE: 03 5655778 FAX: 03 5655146
----------------------------------------------------------------------
Technical Details
Message-ID: <cechew.667604378@sol1>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!munnari.oz.au!bruce!sol1!cechew

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!olivea!uunet!munnari.oz.au!bruce!sol1!cechew
From: cechew@sol1.cs.monash.edu.au (Earl Chew)
Newsgroups: comp.std.c
Subject: int (*f)(void) = 0; int (*f)(void) = (void *) 0;
Summary: Assigning null pointers to function pointers
Keywords: function pointers, null pointers
Message-ID: <cechew.667604378@sol1>
Date: 26 Feb 91 21:39:38 GMT
Sender: news@bruce.cs.monash.OZ.AU
Lines: 16