Mail Archives: djgpp-workers/2002/05/31/03:46:53
> Date: Wed, 29 May 2002 20:56:01 +0100
> From: "Richard Dawe" <rich AT phekda DOT freeserve DOT co DOT uk>
>
> There's scope for making the wrapper functions common, e.g. by making
> them library functions, e.g. __FSEXT_call_open_handlers2() which has
> a variable number of parameters rather than taking a va_list?
How about defining an inline function in some header file private to
the library?
> ioctl() and fcntl() are hard to fix, because they take
> a command parameter and a va_list, but we somehow need to include
> the command parameter in the va_list we pass to the FSEXT functions.
> Is there any way of inserting a parameter into a va_list. I had
> a look at the C99 standard, but there seems to be no way to do.
>
> The approach below with ioctl() is that we have two va_lists -
> one including the command parameter, one without. We pass
> command+others to the FSEXT. But gcc gives a warning in this case,
> because the command parameter is not the last one before '...'.
It strikes me that we should simply compile ioctl with less stringent
warning switches, and leave the code as it was. It doesn't make sense
to try to comply with the crazy GCC 3.x criteria for warning-free code
in a platform-specific function such as ioctl and fcntl. We _know_
what we are doing, and we _know_ there's no chance that code will ever
be portable.
The rest of the changes seem okay by inspection, but please make sure
that whatever changes you make in FSEXT-related parts don't break
existing uses of FSEXT, like dbgcom.c, GNU `ls', Ispell, etc.
- Raw text -