[PATCH v2] assert: Refactor assert/assert_perror

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Wed Aug 20 11:07:41 GMT 2025



On 19/08/25 18:32, Florian Weimer wrote:
> * Adhemerval Zanella Netto:
> 
>>> Why do we need __libc_message_nargs when things go into a varargs
>>> function without an explicit argument count in the end anyway?
>>
>> This is the same logic from sysdep/unix/syscall.h, used on INLINE_SYSCALL_CALL,
>> and it is required to correctly paste the argument is the expected order.  I
>> think maybe there is a better way to accomplish it.
> 
> This is used for INLINE_SYSCALL_CALL etc. because the final target is
> not variadic, but has a fixed number of arguments (loading only the
> registers that are really required).  This isn't the case here as far as
> I can see: the final function call is still variadic.

I used the same strategy to try catch misuse with more arguments than
supported at compile time, but since eeb7b079d5d8785e760ca08c3692ffa579bbb737
we also have a runtime check so this is not strictly required. I still
think this is a nice think to have.


More information about the Libc-alpha mailing list