From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,31c63f07e48d5471 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-19 18:36:39 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Ada to 'C' parameter passing problem Date: 19 Feb 2003 18:36:38 -0800 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0302191836.743eab91@posting.google.com> References: NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1045708599 9277 127.0.0.1 (20 Feb 2003 02:36:39 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 20 Feb 2003 02:36:39 GMT Xref: archiver1.google.com comp.lang.ada:34245 Date: 2003-02-20T02:36:39+00:00 List-Id: rod.chapman@praxis-cs.co.uk (Rod Chapman) wrote in message news:... > Pat.Donahue@msfc.nasa.gov (Patrick) wrote in message news:... > > I am using GNAT Ada on Linux. I am trying to port from a Sun > > (Solaris) implementation. I didn't write the Ada or 'C' myself, but > > am trying to make it work on Linux. > > > This code looks mildly horrible. All that messing about with > 'Address and Unchecked_Conversion is in very poor style. > > My advice: > > 4) A C function that has multiple side-effects via > by-reference parameters shouldn't > be a function in Ada at all - it's a procedure! No, Rod, it's a subprogram that returns a value. There is no difference between a function and a procedure, except for syntax. That Ada doesn't allow you to specify inout mode for function parameters is a deficiency of Ada, especially since it advertises itself as a language that is supposed to facilitate inter-language programming.