[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev Re: casts
From: |
T.E.Dickey |
Subject: |
Re: lynx-dev Re: casts |
Date: |
Tue, 19 Oct 1999 22:05:04 -0400 (EDT) |
>
> In a recent note, Webmaster Jim said:
>
> > Date: Tue, 19 Oct 1999 17:13:58 -0400
> >
> > > Casting the first parameter of FD_SET to (unsigned) looks completely
> > > wrong to me. I haven't seen any other programs that do this.
> > > File descriptors on Unix are int, not unsigned.
>
> > > If your system (with the specific Borland compiler and header files)
> > > needs (unsigned), it is incompatible with most of the rest of the
> > > world... The rest of the world shouldn't have to adapt. Rather
> > > the definition/implementation of FD_SET itself do the cast itself,
> > > if that's what it takes.
> >
> > Presumably a Borland screw-up. I don't know what a negative file
> > descriptor would mean, so assumed unsigned was just a saftey catch.
no - a M$ screwup - it's in the context of winsock2. (I didn't notice
before - sorry, but it "should" be typed 'SOCKET' for that, which happens
to be an unsigned type). That's basically because M$ moved the errno
handling to a separate function (breaking compatibility, but I assume
discarded for multithreaded applications).
--
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey