From: CRDGW2::CRDGW2::MRGATE::"SMTP::AI.MIT.EDU::GNULISTS" 28-FEB-1991 08:20:06.15 To: ARISIA::EVERHART CC: Subj: Re: RPC problems with gcc From: gnulists@ai.mit.edu@SMTP@CRDGW2 To: Everhart@Arisia@MRGATE Received: by crdgw1.ge.com (5.57/GE 1.87) id AA00665; Thu, 28 Feb 91 08:13:00 EST Received: by life.ai.mit.edu (4.1/AI-4.10) id AA19986; Thu, 28 Feb 91 02:40:25 EST Return-Path: Received: from wheat-chex (wheat-chex.ai.mit.edu) by life.ai.mit.edu (4.1/AI-4.10) id AA19967; Thu, 28 Feb 91 02:39:43 EST Received: by wheat-chex (4.1/AI-4.10) id AA00726; Thu, 28 Feb 91 02:39:47 EST Resent-Date: 27 Feb 91 21:22:47 GMT Resent-From: gnulists@ai.mit.edu Resent-Message-Id: <9102280739.AA00726@wheat-chex> Received: from tut.cis.ohio-state.edu by life.ai.mit.edu (4.1/AI-4.10) id AA06041; Wed, 27 Feb 91 17:23:30 EST Received: by tut.cis.ohio-state.edu (5.61-kk/5.910130) id AA07289; Wed, 27 Feb 91 17:19:58 -0500 Received: from USENET by tut.cis.ohio-state.edu with netnews for help-gcc@prep.ai.mit.edu (help-gcc@prep.ai.mit.edu) (contact usenet@tut.cis.ohio-state.edu if you have questions) Date: 27 Feb 91 21:22:47 GMT From: khera@cs.duke.edu (Vick Khera) Sender: gnulists@ai.mit.edu Organization: Duke University CS Dept., Durham, NC Subject: Re: RPC problems with gcc Message-Id: References: To: help-gcc@prep.ai.mit.edu In article <19134@brahms.udel.edu> gdtltr@brahms.udel.edu (root@research.bdi.com (Systems Research Supervisor)) writes: In article drapeau@sioux.stanford.edu writes: =>In article patrick@beppe15.ericsson.se (Patrick Sendek) writes: => => Is anyone else having similar results? Does anyone know of a possible solution => for this problem? => =>I've run into the same problem (although with gcc 1.37). I know which =>piece of code in the RPC source causes the problem; I wish I knew =>enough about the difference between gcc and Sun cc to know why this =>problem comes about. Maybe somebody here can illuminate us all. => =>The problem appears to be in the function "clnttcp_call"; the problem =>is the last parameter, a "struct timeval". I modified the function =>so that it takes a "struct timeval*"; this cleared things up. => Perhaps this is obvious, but did you try -fpcc-struct-return? That sounds like the the symptom this flag is meant to deal with. not quite. -fpcc-struct-return deals with returning structures, not passing them as arguments. according to the gcc manual, the way gcc and Sun's sparc cc deal with passing parameters is incompatible, and will stay that way. rumor has it that it is fixed in 2.0, whenever that may come out. as it stands, if you are going to pass structures then make sure that both the caller and callee are compiled by the same compiler. you will note that dbm routines also have this situation. gcc and cc work well together on the Sun 3's though. an excerpt from the gcc manual, section on incompatibilities: * On the Sparc, GNU CC uses an incompatible calling convention for structures. It passes them by including their contents in the argument list, whereas the standard compiler passes them effectively by reference. This really ought to be fixed, but such calling conventions are not yet supported in GNU CC, so it isn't straightforward to fix it. The convention for structure returning is also incompatible, and `-fpcc-struct-return' does not help. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Vick Khera, Gradual Student/Systems Guy Department of Computer Science ARPA: khera@cs.duke.edu Duke University UUCP: ...!mcnc!duke!khera Durham, NC 27706 (919) 660-6528