This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

EGCS-19990502 and ANSI C


I don't know in which version this begins, but it seems that EGCS-19990502
has problems with compiling C++ (with two pluses) programs which use
linux/socket.h (or sys/socket.h, which includes it). This happens with
kernel 2.2.7's, also with 2.2.6, but it will probably happen with earlier
kernels too.

The problem is that on line 109 of socket.h we have a "return NULL" in a
function which should return (cmsghdr *). When compiling normal C programs,
everything is ok, not a warning nor an error, but when you try to compile a
C++ program (if you use g++, or try to compile a .cpp file, or just include
iostream.h, for example), you will get an error:

/usr/include/linux/socket.h: In function `struct cmsghdr *
__cmsg_nxthdr(void *, unsigned int, cmsghdr *)':
/usr/include/linux/socket.h:109: ANSI C++ forbids implicit conversion from
`void *' in return

With older versions of EGCS (I've tried 1.0.3) this is just a warning, but
the program compiles, however, now it refuses to compile such a program.

Isn't this a bug? I mean, this is not something for which a compilation
should be refused, it should be a warning at most...


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]