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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f34f1a1939dc0c40 X-Google-Attributes: gid103376,public From: "Ira D. Baxter" Subject: Re: conditional compilation Date: 2000/07/31 Message-ID: #1/1 X-Deja-AN: 652811942 References: <87d7jvp3qq.fsf@chiark.greenend.org.uk> <39857E5F.33C40014@acm.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: newsabuse@supernews.com Organization: Posted via Supernews, http://www.supernews.com X-MSMail-Priority: Normal Newsgroups: comp.lang.ada Date: 2000-07-31T00:00:00+00:00 List-Id: Conditional compilation is a really practical tool for managing part of the configuration space problem, which is why it is so popular in C/C++. It is true that if you implement it as a preprocessor, that you end up with all kind of abominable constructs (this found in real code): if (.....) { ...... #if ... ..... } else { ... #endif ... endif [I see this an an indictment of the programmer, not the language, but it would be nice if the language prevented it]. A real problem in understanding such constructs is not only just other maintainer's ability to understand what it says, but an inability to get a tool that can read such a construct and reason about it (extract call graphs, etc.) This is a significant problem for the reverse engineering and analysis tools we build. It is much better if the language enables conditional compilation directly. We have an internal programming language, not Ada, in which conditional compilation is allowed (defined in the grammar) around the major language constructs: function defintions, declarations, modules, etc., and it works very nicely without allow silly stuff like the above. Much easier to handle for automated tools, as well as people. -- Ira Baxter, Ph.D., CTO idbaxter@semdesigns.com 512-250-1018x140 Semantic Designs, Inc., www.semdesigns.com FAX 512-250-1191 12636 Research Blvd #C214, Austin, Texas 78759 Marin D. Condic wrote in message news:39857E5F.33C40014@acm.com... > Matthew Woodcraft wrote: > > > > I noticed the following statement in the Steelman requirements: > > > > "6C. Conditional Control. There shall be conditional control structures > > that permit selection among alternative control paths. > > ... > > Only the selected branch shall be compiled when the discriminating > > condition is a translation time expression." > > > > Now I'm not sure that a true conditional compilation feature based on > lexical exclusion is really such a good idea.