linux/socket.h C++ compilation failure

=?iso-8859-1?Q?Johnny_Teve=DFen?= (j.tevessen@gmx.net)
Wed, 12 May 1999 04:21:04 +0200


Hi!

Compiling the kdesupport package on Linux-2.2.6ac1/x86/glibc1
I noticed that the C++ compiler[1] stopped at this point:

/usr/include/linux/socket.h:109: ANSI C++ forbids implicit conversion from `void *' in return

Well, I think the compiler is right. Here's a patch:

--- linux/include/linux/socket.h~ Thu Apr 22 01:51:11 1999
+++ linux/include/linux/socket.h Wed May 12 04:16:30 1999
@@ -106,7 +106,7 @@

__ptr = (struct cmsghdr*)(((unsigned char *) __cmsg) + CMSG_ALIGN(__cmsg->cmsg_len));
if ((unsigned long)((char*)(__ptr+1) - (char *) __ctl) > __size)
- return NULL;
+ return (struct cmsghdr *) NULL;

return __ptr;
}

[1] gcc version egcs-2.93.19 19990418 (gcc2 ss-980929 experimental)

-- 
J. Tevessen, Germany
PGPkey: http://pgp.lsi.upc.es:11371/pks/lookup?op=get&search=0x5C77B04D

- 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/