_z33 wrote:

> > Functions are only "jump" labels. Thou you cant expect a program to work 
> > if you cross typecast functions with different argument (or return) 
> > values. This because the function expects arguments to be in "right" 
> > register or stack position. And caller expects return values to be in 
> > right register.
> > 
> > // Jarmo
> 
> excerpt from a discussion here @
> 
> ...
>    ANSI Classic section 3.3.4, page 47 lines 4 to 5:  "A pointer to a
> function of one type may be converted to a pointer to a function of another
> type and back again; the result shall compare equal to the original 
> pointer."
> ...
> 
> 
>    Seems to confuse me a lot. I didn't understand the ABC's of the 
> quoted discussion; nevertheless, this line there in the discussion, 
> still stings me :(
>    What does it mean?

All it really means is that all function pointers are the same size
regardless of their type.

>    First of all, why should be function pointers be typecasted to 
> something else?

Storage. You might want to store pointers to different types of
functions in a common variable or structure field.

-- 
Glynn Clements <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" 
in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to