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,c35edbbda4c7f58f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!attbi_s01.POSTED!53ab2750!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Conditional compilation in Ada? References: X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 67.161.24.234 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s01 1100631990 67.161.24.234 (Tue, 16 Nov 2004 19:06:30 GMT) NNTP-Posting-Date: Tue, 16 Nov 2004 19:06:30 GMT Organization: Comcast Online Date: Tue, 16 Nov 2004 19:06:30 GMT Xref: g2news1.google.com comp.lang.ada:6225 Date: 2004-11-16T19:06:30+00:00 List-Id: >a small change in a fundamental data structure. Both versions of the >data structure are mostly handled the same way (within thousands of >lines of source code), but there are some 10 or 20 (number still >growing) places where minor changes are necessary. What is worse, You can use an "if" statement. if Is_Version1 then ... else ... If you define Is_Version1 at the top, or in another small package, as Is_Version1 : constant Boolean := True; then an intelligent compiler will not generate any code for the impossible Is_Version1 = False condition or the if-test itself. That is, it will be identical in effect to C conditional compilation. If the "minor changes" are similar, you could change the processing in the many places in the huge module to instead call a subroutine and then only make changes/ifs in the body of that subroutine (or subroutines).