Paul Eggert writes:
> 
> I should warn you that the C Standard does not allow that sort of
> cast.  This is for portability to hosts that use different
> representations for different kinds of pointers; such hosts can use
> different calling conventions for char * and void *, so casting the
> function pointer will result in code that doesn't work.  Admittedly
> such hosts are rare (typically they're word-oriented machines) but
> all other things being equal we might as well port to them.

As far as I know, such hosts are non-existent.  While what you say is
quite correct for other pointer types, the C Standard requires char *
and void * to have the same representation and alignment and notes that
that is intended to allow them to be used interchangably as arguments to
unprototyped functions, so only a deliberately perverse implementation
would fail.

-Larry Jones

In my opinion, we don't devote nearly enough scientific research
to finding a cure for jerks. -- Calvin


_______________________________________________
bug-gnulib mailing list
bug-gnulib@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-gnulib

Reply via email to