[Fwd: [ale] C++, sockets, 2.2.12]

Benjamin Scherrey scherrey at switchco.com
Mon Oct 4 14:29:19 EDT 1999


This is a multi-part message in MIME format.
--------------9784738999F988CAF8F66139
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Wish ALE's list would populate the reply-to field...
--------------9784738999F988CAF8F66139
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

X-Mozilla-Status2: 00000000
Message-ID: <37F8EBC9.E035DDC7 at switchco.com>
Date: Mon, 04 Oct 1999 13:02:49 -0500
 From: Benjamin Scherrey <scherrey at switchco.com>
Reply-To: scherrey at proteus-tech.com
Organization: Proteus Technologies, Inc.
X-Mailer: Mozilla 4.61 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: Joe Knapka <jknapka at charter.net>
Subject: Re: [ale] C++, sockets, 2.2.12
References: <37E93FDC.421F6460 at charter.net>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

The socket.h file is performing the cast or is your code performing
the cast of the void* return result from a function in socket.h? I
haven't been building any socket code recently but all my other
system-level stuff has been working fine with gcc 2.95.1. FWIW, there
is a switch you can pass to the compiler that doesn't enforce the ANSI
spec as tough that will let you build such code (-fpendantic ??? sorry
I forget exactly what it is). If you can't figure it out then provide
some details about the function causing the problem.

	regards & good luck,

		Ben Scherrey

Joe Knapka wrote:
> 
> Hello, all,
> 
> [Techie coding problem alert - hit delete if you're allergic]
> 
> I've got some C++ code that uses sockets. It compiled fine under
> 2.2.12, until today when I upgraded to GCC-2.95.1. Now I get
> an error in /usr/include/linux/socket.h (included by sys/socket.h)
> because an internal kernel function defined inline in the header
> is violating an ANSI C++ restriction on casting of return
> values (it's trying to return a void* from a function defined
> to return a struct cmsghdr*). This happens regardless of whether
> I #include these things inside of extern "C" {}.
> 
> Anybody know the answer to this offhand? This is clearly not
> a GCC problem, but it's triggered by GCC's better ANSI
> compliance. It could be considered a kernel bug. Or maybe it's
> something that would be fixed by an upgrade to GNU libc (I'm
> currently using 2.0.7), but I don't think that the socket API is
> part of Glibc. Any advice is appreciated.
> 
> Also, I kind of remember someone saying here that very recent
> versions of GCC will not compile the kernel correctly. Am
> I remembering that correctly? If so, what's a good version
> to use?
> 
> TIA,
> 
> -- Joe
> 
> * Joe Knapka
> * I speak only for myself, not for these idiots:
> * The Software Monastery - "Better Software Through Divine
> * Intervention." Source-code prayer vigils available - nominal
> * donation $0.01/LOC. http://whyme.penguinpowered.com/monastery.html

--------------9784738999F988CAF8F66139--






More information about the Ale mailing list