This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: indirect function support


On Tuesday 18 May 2010 09:00:22, Nathan Sidwell wrote:
> +static void *resolve_memcpy (void)
> +@{
> +  return my_memcpy; // we'll just always select this routine
> +@}

Shouldn't these examples be returning a function pointer instead of a
data pointer?  That's what the ifunc specification says an ifunc returns.
I know that under posix you can convert between these and back, and that
this is only implemented on glibc presently, but it feels like the docs
shouldn't be showing undefined behaviour, non-posix, C confirming,
pedantically speaking.  Returning `void (*)(void)' would be good already,
though `typeof(memcpy) *' would even be nicer.  Just 2c. from a bystander.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]