[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
lynx-dev Re: casts
lynx-dev Re: casts
Tue, 19 Oct 1999 17:13:58 -0400
On Tue, Oct 19, 1999 at 09:12:16AM -0500, Klaus Weide wrote:
> On Tue, 19 Oct 1999, Webmaster Jim wrote:
> I wish you could have "just ignored the messages" from that Borland
> compiler, or found a switch to turn them off...
Sorry, I sometimes assume compiler authors know more than I do :-)
> There doesn't seem a point to most of those warnings you are trying
> to suppress. Or if there is, then maybe it should be fixed in the
> header files (e.g., what is BOOL?).
I'd certainly agree to fixing the source of the warnings in a more
logical fashion. "BOOL" is short for BOOLEAN; why have both?
Why not just use TRUE/FALSE? I have no idea...
This could be wiped out of HTUtils.h, leaving just BOOLEAN:
#define BOOL BOOLEAN
Or just use char, which is what BOOLEAN is typdef'd to.
> 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.
> My linux man page for select even lists specifically:
> FD_CLR(int fd, fd_set *set);
> FD_ISSET(int fd, fd_set *set);
> FD_SET(int fd, fd_set *set);
> FD_ZERO(fd_set *set);
> 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.
> So, shouldn't we get rid of some of theses casts? At least for file
Sure, if it makes the code better for all.
Marvin the Paranoid Android says:
You realise whilst I was doing that I also calculated the number
of oxygen atoms within a radius of ten light years of here?
But I don't expect anyone to appreciate me for it.