Mark Crispin wrote:
You can disregard these warnings entirely.

A few pedantic C compilers get upset at the use of void* as a bucket to hold an arbitrary cell, even though this is often the only way to do something *and* the programmer indicated his intent with an explict cast (which supposedly tells the compiler "I know what I'm doing, damnit!").

Okay. Tho, in these cases you're casting a 64-bit pointer to and from a 32-bit unsigned int. So, it's not wrong to warn about it.

Sigh. On some systems, it's an int* (and socklen_t is undefined). On some, it's a socklen_t*. And on some, it's a size_t* (and socklen_t is undefined). At UW, we have examples of all three; and there's no good way for the code to know what it is on the system being built. That's why c-client casts it to a void*.

Right. I understand the problem.

There's simply no way to win on every possible platform.

Well, without having some sort of "smart" system, or lots of OS-dependent #def's or typedef's for things...

I suggest that the best thing to do is have the NETBSD osdep files redefine getsockname() as a jacket function into the real one. Take a look at the SCO osdep files for an example (e.g. how rename() gets redefined). Of course, that assumes that all NETBSD is 64 bit or at least follows the socklen_t* convention; if not then a new port has to be spawned off.

Eep. Well, I'm willing to presume all NetBSD's (at least of a relatively recent vintage) have a socklen_t, so that will work. Seems an ugly way to do it tho.

  Obviously, you've chosen not to go down the autoconf path
already.  But, you could have each OS define what it's
socklen type is, like you do with a few other config things
in the Makefile.  Or is that just opening a larger can
of worms than you're comfortable with (despite, IMO, doing
much that already for other things)?

- Chris

Reply via email to