Re: null function pointer?
- From: pete <pfiland@xxxxxxxxxxxxxx>
- Date: Wed, 12 Oct 2005 14:30:25 GMT
Chris Torek wrote:
>
> >> Keith Thompson <kst-u@xxxxxxx> writes:
> >> > There is no conversion, explicit or implicit,
> >> > defined between object pointers and function pointers
>
> >Tim Rentsch wrote:
> >> Technically not quite correct. The code
> >>
> >> int (*pf)(void);
> >>
> >> pf = (void*)0;
> >>
> >> converts an object pointer value to a function pointer.
> >> It's true, the object pointer expression in this
> >> case is also a null pointer constant,
> >> but the expression still yields a value of object pointer type,
> >> and that value is converted by the assignment.
>
> In article <434CC4D1.5A1B@xxxxxxxxxxxxxx>
> pete <pfiland@xxxxxxxxxxxxxx> wrote:
> >No.
> >(void *) is a pointer to an incomplete type,
> >not a pointer to an object type.
>
> Indeed, although "pointer to incomplete [data] type" could be
> considered a sub-group of "pointer to object type", or more
> generically, "data pointer" -- to be distinguished from "function
> pointer", a la Harvard architectures in general.
No.
In C, there's three kinds of types:
1 object
2 incomplete
3 function
What Keith Thompson wrote is just simply and completely
accurate and useful to know, as far as C is concerned.
--
pete
.
- References:
- null function pointer?
- From: Alexei A. Frounze
- Re: null function pointer?
- From: Keith Thompson
- Re: null function pointer?
- From: Tim Rentsch
- Re: null function pointer?
- From: pete
- null function pointer?
- Prev by Date: Re: comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ)
- Next by Date: Re: [OT] Re: volatile and "needed side effects"
- Previous by thread: Re: null function pointer?
- Next by thread: Re: null function pointer?
- Index(es):
Relevant Pages
|