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,2def9aa85afa5d22 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-30 09:09:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed.berkeley.edu!news-hog.berkeley.edu!ucberkeley!enews.sgi.com!newscon06.news.prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr30.news.prodigy.com.POSTED!not-for-mail From: "Pat Rogers" Newsgroups: comp.lang.ada References: <3BDCE159.39F6D422@adaworks.com> <11bf7180.0110290311.4d8d6f04@posting.google.com> <3BDF9C6A.C25520C5@adaworks.com> <3BE023AB.8F235EF5@sparc01.ftw.rsc.raytheon.com> <9rp8mo$6d8$1@nh.pace.co.uk> <11bf7180.0111010338.6dbc1537@posting.google.com> <9u5q9g$md$1@nh.pace.co.uk> Subject: Re: Joint Strike Fighter X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: NNTP-Posting-Host: 208.191.176.121 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr30.news.prodigy.com 1007140138 ST000 208.191.176.121 (Fri, 30 Nov 2001 12:08:58 EST) NNTP-Posting-Date: Fri, 30 Nov 2001 12:08:58 EST Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: SCSYASJGTZYQBQXYQ[OD]_HBWB]^PCPDLXUNNHPIMASJETAANVW[AKWZE\]^XQWIGNE_[EBL@^_\^JOCQ^RSNVLGTFTKHTXHHP[NB\_C@\SD@EP_[KCXX__AGDDEKGFNB\ZOKLRNCY_CGG[RHT_UN@C_BSY\G__IJIX_PLSA[CCFAULEY\FL\VLGANTQQ]FN Date: Fri, 30 Nov 2001 17:08:58 GMT Xref: archiver1.google.com comp.lang.ada:17229 Date: 2001-11-30T17:08:58+00:00 List-Id: "Simon Wright" wrote in message news:x7v667sb4yc.fsf@galadriel.frlngtn.gecm.com... > Ted Dennison writes: > > > If it took up more than a register I'd say you have a legitimate > > gripe with your compiler vendor. However, you definitely should use > > one of the forms gauranteed to pass by reference if you *need* it > > passed that way for some reason. If you just want it to do the most > > efficient thing (which is the ususal rationale I hear from the C > > refugees), just let the compiler do it. > > This was the bug report: > > I have a (private) type Socket: > > type Socket is record > Fd : Integer; -- -1 => socket is closed > end record; > > > so making Socket limited would have done as well (I can now see no > reason why I shouldn't have done that .. this was a while back, may > have been a reason at the time). Anyway, it really needed to be by > reference! One could use the pragma Volatile trick when a limited type is unacceptable: make a (hidden) null record type, apply pragma Volatile to it, and have a component of this type in the final exported type (e.g. type Socket). The enclosing type (Socket) is then required to be passed by reference and no extra storage is required. I don't remember where I saw this first, but I suspect it was from J.P. Rosen -- one of the most clever Ada people around. -- --- Patrick Rogers Consulting and Training in: http://www.classwide.com Real-Time/OO Languages progers@classwide.com Hard Deadline Schedulability Analysis (281)648-3165 Software Fault Tolerance