Re: Reducing compilation warnings in imsg.c on FreeSBD

2015-11-16 Thread Ted Unangst
Craig Rodrigues wrote: > I tried the following and was able to compile without warning: > > Index: imsg.c > === > --- imsg.c (revision 290924) > +++ imsg.c (working copy) > @@ -74,7 +74,7 @@ > > again: > if (getdta

Re: Reducing compilation warnings in imsg.c on FreeSBD

2015-11-16 Thread Craig Rodrigues
On Mon, Nov 16, 2015 at 9:03 AM, Philip Guenther wrote: > >> integers of different signs: 'unsigned long' and 'int' [-Wsign-compare] > >> >= getdtablesize()) { > >> ^ ~~~ > >> 1 warning generated. > > Out of curiousity, in your experience how often is that war

Re: Reducing compilation warnings in imsg.c on FreeSBD

2015-11-16 Thread Theo de Raadt
> > Both OSs define getdtablesize() as sysconf(_SC_OPEN_MAX). sysconf(3) > > returns a long, so it seems more correct to make getdtablesize(3) return > > a long or ssize_t. The return value has to be signed because sysconf(3) > > is specified by POSIX to return -1 and set errno on failure. > > No,

Re: Reducing compilation warnings in imsg.c on FreeSBD

2015-11-16 Thread Mark Kettenis
> Date: Mon, 16 Nov 2015 11:41:09 -0500 > From: Michael McConville > > Craig Rodrigues wrote: > > Recently, I imported imsg.c from OpenBSD to the > > FreeBSD base system's libopenbsd: > > > > https://svnweb.freebsd.org/changeset/base/290375 > > > > When compiling on FreeBSD, we get a compiler w

Re: Reducing compilation warnings in imsg.c on FreeSBD

2015-11-16 Thread Philip Guenther
On Mon, Nov 16, 2015 at 8:41 AM, Michael McConville wrote: > Craig Rodrigues wrote: >> Recently, I imported imsg.c from OpenBSD to the >> FreeBSD base system's libopenbsd: >> >> https://svnweb.freebsd.org/changeset/base/290375 >> >> When compiling on FreeBSD, we get a compiler warning with clang:

Re: Reducing compilation warnings in imsg.c on FreeSBD

2015-11-16 Thread Theo de Raadt
> Both OSs define getdtablesize() as sysconf(_SC_OPEN_MAX). sysconf(3) > returns a long, so it seems more correct to make getdtablesize(3) return > a long or ssize_t. The return value has to be signed because sysconf(3) > is specified by POSIX to return -1 and set errno on failure. Don't be ridicu

Re: Reducing compilation warnings in imsg.c on FreeSBD

2015-11-16 Thread Michael McConville
Craig Rodrigues wrote: > Recently, I imported imsg.c from OpenBSD to the > FreeBSD base system's libopenbsd: > > https://svnweb.freebsd.org/changeset/base/290375 > > When compiling on FreeBSD, we get a compiler warning with clang: > > cc -O2 -pipe -I/opt2/branches/head2/lib/libopenbsd -std=gn

Reducing compilation warnings in imsg.c on FreeSBD

2015-11-16 Thread Craig Rodrigues
Hi, Recently, I imported imsg.c from OpenBSD to the FreeBSD base system's libopenbsd: https://svnweb.freebsd.org/changeset/base/290375 When compiling on FreeBSD, we get a compiler warning with clang: cc -O2 -pipe -I/opt2/branches/head2/lib/libopenbsd -std=gnu99 -fstack-protector-strong -Wsys