Re: C++ warnings from system header 'socketbits.h' : can we clean this up?

Thomas Wouters (thomas@xs4all.nl)
Fri, 12 Mar 1999 17:49:03 +0100


On Fri, Mar 12, 1999 at 10:34:19AM -0600, Ron Flory wrote:

<..>
> Basically the problem is due to an old C hack where folks
> assume the macro NULL evaluates to 0. In C++ NULL is defined
> as '(void*) 0' which is quite distinct from zero, and may not
> be freely converted to an integer.

<..>

> /usr/include/socketbits.h: In function `struct cmsghdr *
> __cmsg_nxthdr(struct msghdr *, struct cmsghdr *)':

<..>

Wrong mailing list. That particular include file is part of libc, not of the
kernel. As a side note i dont understand how ANSI C++ can allow an implicit
conversion of a literal integer to a pointer to a struct, but not a void
pointer to a pointer to a struct. This also implies all code which should
return pointers and do 'return NULL;' are now to be considered broken (in
C++), which, quite frankly, scares me. Are you sure this is the problem ?
(Also, take a look at your libc, libc5/libc6/whatever, and bug its authors :-)

Regards,
Thomas.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/