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-Thread: 103376,c76d41708bf94f23 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!goblin2!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: c2ada bug report filed Date: Thu, 31 Mar 2011 22:03:52 +0100 Organization: A noiseless patient Spider Message-ID: References: <3a657bf9-89ed-45c8-bd4d-f226cb3bc5fa@w7g2000pre.googlegroups.com> <4d94c18b$0$4966$a8266bb1@postbox2.readnews.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx03.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="8321"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/ADSFv6JoSWs4CNCuIjXFJEJSkx8hoiKQ=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (darwin) Cancel-Lock: sha1:8RWPNTeUj42e2txrFRH+zPBM9w4= sha1:CllsVTlnG3vnvoxnbLhfeypjZDU= Xref: g2news2.google.com comp.lang.ada:19602 Date: 2011-03-31T22:03:52+01:00 List-Id: Per Sandberg writes: > So i expect c2ada to be obsolete at least when GNAT GPL 2011 is > released. GNAT GPL 2010 certainly tries; I don't know how good it is. Just tried on ; GPL 2010 is better than FSF 4.6.0, which didn't understand #define TCL_MAJOR_VERSION 8 for example. Both made a - to my eyes - strange choice about parameter passing: typedef struct Tcl_Interp { ... } Tcl_Interp; translated as type Tcl_Interp is record ... end record; pragma Convention (C_Pass_By_Copy, Tcl_Interp); Now, the C code that's being called most certainly doesn't expect pass-by-copy; and the generated binding always says (eg) function Tcl_AppInit (arg1 : access Tcl_Interp) return int; Wouldn't pragma Convention (C) have done? For interest, the tcladashell equivalent (which, I believe, was originally generated using c2ada, but has since been heavily hand-amended) is type Tcl_Interp_Rec (<>) is private; type Tcl_Interp is access all Tcl_Interp_Rec; pragma Convention (C, Tcl_Interp); function Tcl_AppInit (interp : in Tcl_Interp) return C.int; I shall have a think about this, the 'access' approach is certainly neat. There's the question of whether null is allowed; if it is, and customers are using Ada95, 'access' is ruled out.