[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Casting hell (was: can't compile on NetBSD)

From: Klaus Weide
Subject: lynx-dev Casting hell (was: can't compile on NetBSD)
Date: Tue, 19 Oct 1999 09:12:16 -0500 (CDT)

On Tue, 19 Oct 1999, Webmaster Jim wrote:

> It's just a warning that "unix" is deprecated. It started in NetBSD
> 1.4, presumably because "unix" is fairly meaningless as a preprocessor
> definition these days. I just ignore the message.

I wish you could have "just ignored the messages" from that Borland
compiler, or found a switch to turn them off...

Most of the casts added to shut up that specific compiler (in
2.8.3dev.7) are ugly, unnecessary for more reasonable compilers,
and most likely do more harm than good (like, masking real problems
that would otherwise get detected).

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?).

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.

So, shouldn't we get rid of some of theses casts?  At least for
file descriptors?

All just IMO and AFAIK, of course.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]