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,d89b829a7e0c6c44 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!h54g2000cwb.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: GNAT-2005 Date: 10 Nov 2006 08:56:42 -0800 Organization: http://groups.google.com Message-ID: <1163177802.563194.164270@h54g2000cwb.googlegroups.com> References: <1163141479.498169.10580@b28g2000cwb.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1163177807 32219 127.0.0.1 (10 Nov 2006 16:56:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Nov 2006 16:56:47 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: h54g2000cwb.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:7402 Date: 2006-11-10T08:56:42-08:00 List-Id: Stephen Leake wrote: > "rashmi" writes: > > > I have a problem with trying to understand GNAT's working for the > > following: > > > > > 3. I find that if I delete the first few lines that give specs for > > FUNC_ScBAVCK or FUNC_ScBAFCk, for which records are parameters, and > > then compile the package's body (.adb), GNAT does not report that > > functions are undefined. On the other hand, if I delete a specs line > > such as that for FUNC_BAVCPRd for which scalars are parameters, GNAT > > immediately reports "function FUNC_BAVCPRd undefined" when I compile > > the body. > > Without seeing the body, it's impossible to say. > > Most likely the bodies of the "scalar functions" are present in the > package body _before_ the places they are called. That seems most likely to me, too. Things have to be declared before they can be used (with few exceptions). When you call one of these functions in the body, the compiler has to have seen it previously---either in the spec, or earlier in the body. If you remove the declaration of a function from the spec, it's still OK to call it IF it is defined in the body before it's used---but not if it's defined in the body after it's used. So that's probably why you're getting errors in some cases but not others. -- Adam