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,d6f7b92fd11ab291 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-16 23:44:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!guardian.oit.duke.edu!newsfeed.mathworks.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc01.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Crosspost: Help wanted from comp.compilers References: X-Newsreader: Tom's custom newsreader Message-ID: <_ArRa.80083$ye4.60459@sccrnsc01> NNTP-Posting-Host: 12.234.13.56 X-Complaints-To: abuse@comcast.net X-Trace: sccrnsc01 1058424250 12.234.13.56 (Thu, 17 Jul 2003 06:44:10 GMT) NNTP-Posting-Date: Thu, 17 Jul 2003 06:44:10 GMT Organization: Comcast Online Date: Thu, 17 Jul 2003 06:44:10 GMT Xref: archiver1.google.com comp.lang.ada:40386 Date: 2003-07-17T06:44:10+00:00 List-Id: >The complaint was that some Ada systems recompiled dependents when a file >was compiled, even if the source code had not changed. Consider: -- file testgo1.ads package testgo1 is i : integer := integer'last-1; j : integer := i+2; end testgo1; -- file testgo2.ads with testgo1; package testgo2 is k : integer := testgo1.j; function f return integer; end testgo2; -- file testgo2.adb package body testgo2 is function f return integer is begin return 3;end f; end testgo2; -- file testgo.adb with testgo2; procedure testgo is x : integer; begin x := testgo2.f; end testgo; If compiled with "gnatmake -gnato testgo" the line in testgo1.ads j : integer := i+2; results in a constraint error. If compiled "gnatmake testgo" it doesn't. The procedure testgo can be recompiled with and without -gnato and it doesn't change the behavior compiled into testgo1.ads But 'touch' testgo1.ads to update it's file modification date while changing nothing at all in the source code, and the next time you say "gnatmake testgo" or "gnatmake -gnato testgo", it will recompile testgo1.ads and generate code that does (-gnato) or does not (no -gnato) raise a constraint error. That's an example of a case where a textually unchanged spec file needs to be recompiled because of a change in compiler options. Other compilers might lay out records differently according to compiler switches telling them to optimize for space/time. That would require cascading recompiles where the only change is to compiler optimization switches, not to any source files.