Re: [PATCH 2/4] tools/nolibc: avoid unused parameter warnings for ENOSYS fallbacks
From: Thomas Weißschuh
Date: Sun Sep 17 2023 - 11:08:11 EST
On 2023-09-17 11:48:27+0200, Willy Tarreau wrote:
> [..]
> > Maybe the macro-equivalent of this?
> >
> > static inline int __nolibc_enosys(...)
> > {
> > return -ENOSYS;
> > }
> >
> > The only-vararg function unfortunately needs C23 so we can't use it.
> >
> > It's clear to the users that this is about ENOSYS and we don't need a
> > bunch of new macros similar.
>
> I like it, I didn't think about varargs, it's an excellent idea! Let's
> just do simpler, start with a first arg "syscall_num" that we may later
> reuse for debugging, and just mark this one unused:
>
> static inline int __nolibc_enosys(int syscall_num, ...)
> {
> (void)syscall_num;
> return -ENOSYS;
> }
But which syscall_num to use, as the point of __nolibc_enosys() would be
that no syscall number is available and the defines are missing.
For debugging we could add a string argument, though.