comp.lang.ada
 help / color / mirror / Atom feed
From: "Ira D. Baxter" <idbaxter@semdesigns.com>
Subject: Re: conditional compilation
Date: 2000/07/31
Date: 2000-07-31T00:00:00+00:00	[thread overview]
Message-ID: <sob6h7at9ft170@corp.supernews.com> (raw)
In-Reply-To: 39857E5F.33C40014@acm.com

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 <mcondic-nospam@acm.com> 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.






  reply	other threads:[~2000-07-31  0:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-31  0:00 conditional compilation Matthew Woodcraft
2000-07-31  0:00 ` Marin D. Condic
2000-07-31  0:00   ` Ira D. Baxter [this message]
2000-08-01  0:00   ` Simon Brady
2000-07-31  0:00     ` Marin D. Condic
2000-08-01  0:00     ` Ted Dennison
2000-08-01  0:00       ` Robert A Duff
2000-08-01  0:00         ` Laurent Guerby
2000-08-02  0:00       ` Simon Brady
2000-08-02  0:00         ` Georg Bauhaus
2000-08-02  0:00         ` Simon Brady
2000-08-01  0:00           ` William J. Thomas
2000-08-02  0:00         ` Robert A Duff
2000-08-02  0:00           ` Brian Rogoff
2000-08-03  0:00             ` Robert A Duff
2000-08-02  0:00           ` Georg Bauhaus
2000-08-03  0:00             ` Robert A Duff
2000-08-03  0:00           ` Florian Weimer
  -- strict thread matches above, loose matches on Subject: below --
2000-09-19  0:00 Conditional Compilation Kenneth Kueny
2000-09-19  0:00 ` Ted Dennison
2000-09-19  0:00 ` Jeffrey Carter
2000-09-19  0:00   ` Samuel T. Harris
2000-09-20  0:44     ` Robert Dewar
2000-09-19  0:00 ` E. Robert Tisdale
2000-09-19  0:00   ` Larry Kilgallen
2000-09-19  0:00     ` Jeff Allen
2000-09-20  0:49       ` Robert Dewar
2000-09-19  0:00         ` Bobby D. Bryant
2000-09-24  0:00           ` Robert Dewar
2000-09-19  0:00   ` David Starner
2000-09-20  0:52     ` Robert Dewar
2000-09-20  0:47   ` Robert Dewar
2000-10-09  0:00   ` John McCabe
2000-09-19  0:00 ` David Starner
2000-09-19  0:00 ` Richard Riehle
2000-09-20  1:33 ` tmoran
     [not found]   ` <8qauu3$7ei$1@nnrp1.deja.com>
2000-09-24  0:00     ` Robert Dewar
2000-09-25  2:45       ` Ted Dennison
2000-09-25  0:00         ` peter
     [not found] ` <39CA31F2.E160F0D8@res.raytheon.com>
2000-09-24  0:00   ` Robert Dewar
2001-01-02 13:27 ` Andrew Hately
2001-01-02 16:46   ` Robert Dewar
1989-12-12  0:08 conditional compilation Emery
1988-06-13  0:24 Conditional compilation Steinar Haug
1988-06-17 13:53 ` rds
1988-06-22  0:44   ` Jeff Bartlett
1988-06-23 13:01   ` Arny B. Engelson
1988-06-27 18:01     ` Dave Seward
1988-06-29 13:32   ` brucej
1988-06-17 14:48 ` rjs
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox