comp.lang.ada
 help / color / mirror / Atom feed
* Conditional Compilation
@ 2000-09-19  0:00 Kenneth Kueny
  2000-09-19  0:00 ` Ted Dennison
                   ` (7 more replies)
  0 siblings, 8 replies; 50+ messages in thread
From: Kenneth Kueny @ 2000-09-19  0:00 UTC (permalink / raw)


Does ADA have an analog to the C language #define, #ifdef constructs
commonly used to include or exclude certain blocks of code in different code
versions?

Thanks,

Ken Kueny






^ permalink raw reply	[flat|nested] 50+ messages in thread
* conditional compilation
@ 2000-07-31  0:00 Matthew Woodcraft
  2000-07-31  0:00 ` Marin D. Condic
  0 siblings, 1 reply; 50+ messages in thread
From: Matthew Woodcraft @ 2000-07-31  0:00 UTC (permalink / raw)



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."

Am I right in thinking that the second sentence above isn't true of
Ada-as-we-know-it (for example, if a non-selected branch has a
compile-time error)?

-M-




^ permalink raw reply	[flat|nested] 50+ messages in thread
* re: conditional compilation
@ 1989-12-12  0:08 Emery
  0 siblings, 0 replies; 50+ messages in thread
From: Emery @ 1989-12-12  0:08 UTC (permalink / raw)


Bill Wolfe writes:
>   Now are you REALLY contending that any competent maintainer is 
>   going to fail to understand the following?

>     type foo_bar (MACHINE : SYSTEM{NAME := SYSTEM.SYSTEM_NAME) is record
>        X : Integer;
>        case MACHINE is
>           when VAX => Y : Float_64; 
>           when IBM_PC_WITH_8087 => Y : IEEE_Float;
>        end case;
>     end record;

I contend that any competent compiler will REJECT this code for (at
least) two reasons:
	1.  There is no guarantee that an arbitrary compiler will have
either of the two enumeration values "VAX" or "IBM_PC_WITH_8087" in
the type SYSTEM.NAME.  Furthermore, the declaration is ILLEGAL if the
(enumeration type) SYSTEM.NAME has additional values besides the two
mentioned (although the addition of "when others => null;" would at
least fix this problem.) 
	2.  Even if these two exist, the program is still semantically
ILLEGAL, as you would have two components both named Y, which is not
permitted. 

Furthermore, there are many reasons besides host machine name for
doing separate compilation.  One that comes immediately to mind occurs
when a specific feature is present or absent from the version of the
operating system generated for a given machine.  I've seen this rather
frequently in Unix.

L.T.F.L.
				dave emery
				emery@aries.mitre.org

^ permalink raw reply	[flat|nested] 50+ messages in thread
* Conditional compilation
@ 1988-06-13  0:24 Steinar Haug
  1988-06-17 13:53 ` rds
  1988-06-17 14:48 ` rjs
  0 siblings, 2 replies; 50+ messages in thread
From: Steinar Haug @ 1988-06-13  0:24 UTC (permalink / raw)


Hi,

I'm developing programs for both DEC VAX (VAX/VMS Ada compiler) and
SUN-3 (Alsys Ada compiler). I need to use some form of conditional
compilation. The Alsys compiler has the BEGIN_COMPILE/END_COMPILE
pragmas to control the compilation but I have not found any similar
mechanism for the VAX/VMS compiler. Can anybody out in Adaland tell
me how to do conditional compilation with the VAX/VMS compiler?

The LRM contains a reference [10.6] to conditional compilation but
it seems rather cryptic and it is not obvious to me how I could use
it in practice.

Steinar Haug             ! ARPA:        haug%vax.runit.unit.uninett@tor.nta.no 
Database Research Group  !   or:        steinar@tor.nta.no                     
Computing Research Center! EAN(X.400):  haug@vax.runit.unit.uninett            
 University of Trondheim ! BITNET/EARN: haug@norunit                           
7034 Trondheim, NORWAY   ! VMS Mail:    psi%02422530001003::12423              
                         !       or:    psi%0242211000114::z_haug_s            

^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2001-01-02 16:46 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` David Starner
2000-09-20  0:52     ` Robert Dewar
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-20  0:47   ` Robert Dewar
2000-10-09  0:00   ` John McCabe
2000-09-19  0:00 ` Richard Riehle
2000-09-19  0:00 ` David Starner
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
  -- strict thread matches above, loose matches on Subject: below --
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
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
1989-12-12  0:08 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

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