delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2008/03/27/10:15:38

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
X-Recipient: djgpp-workers AT delorie DOT com
X-Authenticated: #27081556
X-Provags-ID: V01U2FsdGVkX18QoCsKmkcQgANBELvvCdaqjlkarWytM0MctX5/NF
l/XIKD672Av7vl
From: Juan Manuel Guerrero <juan DOT guerrero AT gmx DOT de>
To: djgpp-workers AT delorie DOT com
Subject: Re: fnctl and ioctl warning fixes
Date: Thu, 27 Mar 2008 14:15:24 +0100
User-Agent: KMail/1.9.5
References: <647fe9b10803261239p9e6c5afoc04f2458c6af3923 AT mail DOT gmail DOT com>
In-Reply-To: <647fe9b10803261239p9e6c5afoc04f2458c6af3923@mail.gmail.com>
MIME-Version: 1.0
Message-Id: <200803271415.24740.juan.guerrero@gmx.de>
X-Y-GMX-Trusted: 0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m2RFDsxb016319
Reply-To: djgpp-workers AT delorie DOT com

Am Mittwoch, 26. März 2008 20:39 schrieben Sie:
> The attached patch fixes the following three warnings by
> employing the __FSEXT_func_wrapper inline helper:
> 
> ioctl.c: In function `_unix_ioctl':
> ioctl.c:269: warning: passing arg 3 of pointer to function from
> incompatible pointer type
> ioctl.c: In function `ioctl':
> ioctl.c:325: warning: passing arg 3 of pointer to function from
> incompatible pointer type
> fcntl.c: In function `fcntl':
> fcntl.c:277: warning: passing arg 3 of pointer to function from
> incompatible pointer type
[snip]


Thank you for proposing a solution for this issue.
If we fix it in this way, we should also fix the documentation.  Here is the
verbatim copy of the example included by __FSEXT_get_function from fsext.txh:

@example
_read(int fd, void *buf, int len)
@{
  __FSEXT_Function *func = __FSEXT_get_function(fd);
  if (func)
  @{
    int rv;
    if (func(__FSEXT_read, &rv, &fd))  <--- Here is the fault. fd is int instead of va_list.
      return rv;
  @}
  /* rest of read() */
@}
@end example

As can be seen the example reproduces the faulty code identicaly.  If we fix
the code we should fix the documentation and we should document the wrapper
functions too.

Regards,
Juan M. Guerrero

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019