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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,38159b1b5557a2e7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-01-24 12:44:38 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news.maxwell.syr.edu!logbridge.uoregon.edu!tethys.csu.net!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!newsread3.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail Message-ID: <4012D932.9010509@noplace.com> From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (OEM-HPQ-PRS1C03) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Standard Ada Preprocessor References: <401272E3.4040506@noplace.com> <8LzQb.12619$U%5.77885@attbi_s03> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 24 Jan 2004 20:44:38 GMT NNTP-Posting-Host: 209.165.25.83 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.atl.earthlink.net 1074977078 209.165.25.83 (Sat, 24 Jan 2004 12:44:38 PST) NNTP-Posting-Date: Sat, 24 Jan 2004 12:44:38 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:4785 Date: 2004-01-24T20:44:38+00:00 List-Id: A simple case: Suppose you are developing for an embedded box but you want to do some simple "Smoke Testing" on a PC. For the embedded box, you need a rep clause for some register. For the PC you're dummying that up with something and don't want a rep clause at all. (Or the PC compiler barfs on the rep clause that the embedded compiler accepts.) It would be nice to say "If compiling for the PC with Aonix, use this code (no rep), but if compiling for the target with the Gnat compiler, go use that code..." I've also run into situations where the hardware weenies are working as fast as we software bozos are and every few weeks, you're getting new turns of a board with different hardware in it. You still need to compile for earlier boards but now you have something different - probably with a different rep clause. I don't want to go into some complex CM and build process just for the developmental stuff - I just need a quick and dirty answer to being able to get the code to work on two (or more) boxes short-term. That's why I'm saying that conditional compilation may be ugly and intellectually unsatisfying and not "The Perfect World" but often you've got circumstances that make it the best, expedient choice for fixing a real world situation. And yes, I agree it can be abused. Maybe there is some way of making it simple enough to get a job done but not powerful enough to make an atrocity. But its been observed that there never has been a programming language in which it has been the least bit hard to write bad code. Maybe we can just accept that and live with it. MDC tmoran@acm.org wrote: > > I don't understand what you use rep clauses for. I normally use them > when a data structure must be shared outside my program, by a hardware > device, an OS call, another program, etc. For those, the rep clause does > not change when you change compiler or target machine - unless your target > *requires* a change because it demands a different representation. Not > even a perfect compiler could do that automatically. -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "Face it ladies, its not the dress that makes you look fat. Its the FAT that makes you look fat." -- Al Bundy ======================================================================