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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4f6c032f8ec25cc8,start X-Google-Attributes: gid103376,public From: x1y2z3@my-dejanews.com Subject: Rational Apex and RM 7.4(2) Date: 1998/08/06 Message-ID: <6qbomp$s9k$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 378461651 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Aug 06 08:06:51 1998 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/3.0 (WinNT; I) Date: 1998-08-06T00:00:00+00:00 List-Id: Hi, we have some code containing deferred constants which are imported from C. Gnat has no trouble with this, however I was told by a client that their Rational Apex compiler did not like those constants (I don't know of any specific error messages). The RM says in 7.4(2) "A deferred constant declaration requires a completion, which shall be a full constant declaration ([...]), or a pragma Import (see Annex B).", so what we are doing seems ok. Has anyone else come across this problem (if it is a problem), or are we doing something "naughty"? package A is ... package B is type Foo is private; ... private type Foo is new System.Address; end B; Bar : constant B.Foo; ... private pragma Import (C, Bar, "C_Bar"); end A; A workaround for Apex is to declare a variable in A's private part, Import that and use the variable to complete the constant: private Temp_Bar : B.Foo; pragma Import (C, Temp_Bar, "C_Bar"); Bar : constant B.Foo := Temp_Bar; end A; This gets rather verbose when setting up a dozen constants. Any better ideas? Andrew. -- +----------------------------------------------------------------------+ | Andrew Lynch, MEng (York) / lynch@cci.de | Run, run, as fast as you | | CCI GmbH /alynch@iee.org | can. You can't catch me, | | Lohberg 10 _______/ lyncha@acm.org | I'm the gingerbeard man! | | D-49716 Meppen / Tel. ++49 5931 805-243 | .sig by Anna Gramme | +----------------------------------------------------------------------+ -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum