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,6426898aedaa5880 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!130.81.64.211.MISMATCH!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny01.POSTED!c9e1c1fe!not-for-mail From: Jeffrey Creem User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Pragma for conditional compilation? (Ada 2005 vs. 95) References: <1190879769.361848.188220@22g2000hsm.googlegroups.com> <1190929570.915553.284000@19g2000hsx.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 28 Sep 2007 12:15:01 GMT NNTP-Posting-Host: 71.168.66.159 X-Complaints-To: abuse@verizon.net X-Trace: trndny01 1190981701 71.168.66.159 (Fri, 28 Sep 2007 08:15:01 EDT) NNTP-Posting-Date: Fri, 28 Sep 2007 08:15:01 EDT Xref: g2news2.google.com comp.lang.ada:2186 Date: 2007-09-28T12:15:01+00:00 List-Id: Jeffrey R. Carter wrote: > Jerry wrote: >> >>> The third real old way is to code in the option by a "IF-THEN-ELSE-END" >>> statements and use a Global constant variable(s). Its low tech but it >>> still works. >> >> OK, but my "problem" is in declaring types which I want to be visible >> in 95 but not visible in 05, as 05 provides them itself. An "IF-THEN- >> ELSE-END" solution would have to be in the executable part of the >> program (right?). > > Despite the claim, this will not work. You cannot compile Ada-07 code > with an Ada-95 compiler. Different bodies for different compilers, > selected somehow (project files are a good way with GNAT, as has been > suggested) is the best way to address this issue. > I agree that in general, given where Ada is, the best way to solve these issues is the whole "you have a CM problem" thing...But it really is sort of just a mantra that we repeat and all hope it is true. The problem is that in the C world, for good (sometimes) or evil (equally often) people can portably but painfully use the pre-processor to deal with compiler and platform portability issues. We claim it is a CM problem but of course now you trade a language portability problem for a CM/build chain portability problem. Finding a build system or CM system that works portability is now just another problem to deal with. I am not saying conditional compilation is the real answer, but pointing to something that is outside the language definition as the answer is somewhat of a cop out.