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,355f90547d1b4b5 X-Google-Attributes: gid103376,public From: Pascal MALAISE Subject: Re: PRECOMPILATION Date: 1999/02/10 Message-ID: <36C1E9E8.EE698090@magic.fr>#1/1 X-Deja-AN: 442960694 Content-Transfer-Encoding: 7bit References: <918556681.260459@dedale.pandemonium.fr> <36c0b3ad.367441@news.pacbell.net> X-Client: Magic On Line [unknown@ppp10-164.magic.fr] X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ulysse.magic.fr X-Trace: ulysse.magic.fr 918677992 434 127.0.0.1 (10 Feb 1999 20:19:52 GMT) Organization: Magic On Line Mime-Version: 1.0 NNTP-Posting-Date: 10 Feb 1999 20:19:52 GMT Newsgroups: comp.lang.ada Date: 1999-02-10T20:19:52+00:00 List-Id: Tom Moran wrote: > > >Are there precompilation instructions in Ada95, > >like in C (#ifdef,...etc) ? In other words, how can > >I set compilation conditions ? > Most compilers are smart enough to delete code in a situation like: > Sometimes : constant Boolean := False; > .... > if Sometimes then > stuff; > end if; > ie, if the optimizer knows "stuff" can never be executed, it will > simply drop it and the if-test. > Having worked on well known shrinkwrap software coded with the C > preprocessor, I would STRONGLY recommend against going that route. > Yes, it's just a tool, and judiciously used can be useful. So's a > hydrogen bomb. Is it legal Ada to write Sometimes : constant Boolean := False; if Sometimes then -- representation clause else -- another representation caluse of the same type end if; I think the error will be detected far before the optimizer is involved. -- Pascal MALAISE (priv) mailto:malaise@magic.fr (prof) mailto:malaise@fr.airsysatm.thomson-csf.com