Re: pointer casts



"Dan Maas" <dmaas dcine com> writes:

> > > GCC has a non-standard extension that allows implicit casts
> > > betweeen (void *) and any function pointers.
> >
> > "Even with an explicit cast, it is invalid to convert a function
> > pointer to an object pointer or a pointer to void, or vice versa."
> 
> Violations of this rule could show up as a problem on architectures where
> function pointers are "special," e.g. IA-64 and PPC64. Is GTK working on
> these arches?

GTK+-2.0 has had some testing on IA-64... it certainly compiles and
the tools used in compilation work.

As far as I understand, while function pointers on IA-64 don't point
directly to the code address (they point to a "function descriptor"),
they still are 64-bits and should be fine to store temporarily in a
void *.

No idea about PPC64, but my guess is that any architecture that broke
the size equivalence of function and normal pointers would be "exotic"
enough to cause problems for a lot of software.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]