This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: PING: PATCH: Automatically test IFUNC implementations


> +extern void *__memcpy_chk (void *, const void *, size_t, size_t);
> +extern void *__memmove_chk (void *, const void *, size_t, size_t);
> +extern void *__mempcpy_chk (void *, const void *, size_t, size_t);
> +extern void *__memset_chk (void *, int c, size_t, size_t);

These declarations are already in include/string.h.  In general, you should
never have a local extern declaration like this.  If it's not superfluous,
it means that there is no checking that the signature is correct.  So, if
you seem to need it, then what you really need is to include some other
header file that contains the declaration, or else to add it to some header
file and ensure that the definition sites include that header too.

> +#define FIND_FUNC(func, cond, impl) \
> +  if (cond) \
> +    { \
> +      extern __typeof (func) impl attribute_hidden; \
> +      array[i++] = LIBC_FUNC_INIT (impl); \
> +    }
> +
> +  /* Return the number of IFUNC implementations supported on target
> +     machine.  */
> +#define FUNC_FINDER(func, ...) \
> +  if (strcmp (name, #func) == 0) \
> +    { \
> +      __VA_ARGS__; \
> +      return i; \
> +    }

Put these macros in the common header file so other machines'
implementations can use them too.

These patches do not include adding comments where each selector is defined
reminding us to keep the implementation-list implementation up to date.


Thanks,
Roland


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