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=-0.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_STARTS_WITH_NUMS,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,59d5ec062146fb1f,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-28 21:12:22 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!gatech!paladin.american.edu!auvm!COMPUSERVE.COM!73672.2025 Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada Message-ID: <941029004807_73672.2025_DHR55-2@CompuServe.COM> Date: Fri, 28 Oct 1994 20:48:07 EDT Sender: Ada programming language From: Ken Garlington <73672.2025@COMPUSERVE.COM> Subject: Elaboration Date: 1994-10-28T20:48:07-04:00 List-Id: I suspect that the following nasty behavior of our Ada83 compiler is legal, but just in case, I wanted to ask an Ada-literate crowd: Several applications using our compiler have ended up writing code like the following (apologies in advance for any stupid typos, etc.) Note that the package specs, bodies, and subunits are all compiled separately: ------------------- package UNO is function IS_REALLY_SIMPLE return BOOLEAN; pragma INLINE(IS_REALLY_SIMPLE); procedure DO_SOMETHING; end UNO; package body UNO is function IS_REALLY_SIMPLE return BOOLEAN is begin -- simple one-line return statement end IS_REALLY_SIMPLE; procedure DO_SOMETHING is separate; end UNO; package DOS is function IS_REALLY_SIMPLE return BOOLEAN; pragma INLINE(IS_REALLY_SIMPLE); procedure DO_SOMETHING; end DOS; package body DOS is function IS_REALLY_SIMPLE return BOOLEAN is begin -- simple one-line return statement end IS_REALLY_SIMPLE; procedure DO_SOMETHING is separate; end DOS; with DOS; separate (UNO) procedure DO_SOMETHING is begin if DOS.IS_REALLY_SIMPLE then -- etc. end if; end DO_SOMETHING; with UNO; separate (DOS) procedure DO_SOMETHING is begin if UNO.IS_REALLY_SIMPLE then -- etc. end if; end DO_SOMETHING; ------------------- When we link all this together, the linker fails with a message that UNO and DOS have a circular dependency in the elaboration. If we remove one of the pragma INLINEs, this allows one of the bodies to not be compiled prior to use of the corresponding function IS_REALLY_SIMPLE, so all is well. However, this still seems silly to me, and other compilers can compile and link this application without problem. We tried to think of a way to use pragma ELABORATE to fix this, but couldn't. What does everyone think? Should we expect the linker to have a problem with this? Is there a simple fix to the source, other than removing an INLINE?