[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: more gcc warnings
From: |
Eric Blake |
Subject: |
Re: more gcc warnings |
Date: |
Fri, 08 Jul 2005 23:30:21 +0000 |
> address@hidden (Eric Blake) writes:
>
> > ls.c and stty.c use ioctl without including <sys/ioctl.h>,
> > triggering a warning about implicit declarations. Even worse, since
> > ioctl is a varargs function, this is undefined C (luckily, it
> > compiles and links okay on cygwin).
>
> Thanks for reporting this. POSIX says that <stropt.h> declares ioctl,
> so let's try including that instead.
POSIX spells it <stropts.h> (not <stropt.h>), and only on platforms that
support STREAMS. Cygwin is not one of them, and has no <stropts.h>,
so your patch will not help cygwin. Furthermore, cygwin's <sys/ioctl.h>
is pretty wimpy - it declares JUST ioctl and 3 #defines WINDOWS_*. So
this part of the patch needs a total rework to fix your misspelling and to
still find a solution that supports cygwin.
>
> > id.c calls error (which ultimately gets to the printf family) with a format
> > %u for uid_t and gid_t.
>
> %lu should be good enough; id.c uses that elsewhere. If we run into
> hosts where uid_t and gid_t are wider than long int, then we can worry
> about it later. (Such hosts would not conform to pre-2001 POSIX.)
This part looked fine.
--
Eric Blake
Re: more gcc warnings, Eric Blake, 2005/07/09