Re: [PATCH v6 2/4] Compiler Attributes: Add __overloadable for Clang

From: Miguel Ojeda
Date: Thu Feb 03 2022 - 20:07:54 EST


On Thu, Feb 3, 2022 at 10:04 PM Kees Cook <keescook@xxxxxxxxxxxx> wrote:
>
> That might be an issue, but the *real* issue is the implicit mutation of
> the function into an inline with _additional_ arguments. i.e.
>
> char *strcpy(char * POS p, const char * POS q)
>
> is really
>
> char *strcpy(char * const p, const char * const q, size_t __size_of_p, size_t __size_of_q)

Shouldn't that be

char *strcpy(char * const p, size_t __size_of_p, const char * const
q, size_t __size_of_q)

? i.e. the docs point at this but say:

"...and implicitly pass the result of this call in as an invisible
argument of type `size_t` directly after the parameter annotated with
`pass_object_size`."

Cheers,
Miguel