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-Thread: 103376,634259facc42df7a X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!atl-c08.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Conditional compilation of debug traces without cpp References: <44aaae35$0$5389$626a54ce@news.free.fr> <44ac1562$0$10269$636a55ce@news.free.fr> <1152165198.400494.175100@p79g2000cwp.googlegroups.com> From: Stephen Leake Date: Fri, 07 Jul 2006 06:32:25 -0400 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:Ydtjt5BPJsgm4ExD1ITMrg8BRX4= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 4b0ce44ae3843e73ae4a412925 Xref: g2news2.google.com comp.lang.ada:5550 Date: 2006-07-07T06:32:25-04:00 List-Id: "Martin Krischik" writes: > You could use "GNAT PREPROCESS" - which gives you the same solution as > C/C++: a text preprocessor. With all the advantages and disadvantages. > Well not quite: "GNAT PREPROCESS" writes the preprocessed file to the > drive - which has it's own set advantages and disadvantages. You seem to be implying that the C preprocessor does not write the intermediate file to the disk. The Gnu C preprocessor _does_ write the intermediate file, and deletes it when it is done compiling. There is an option to preserve the file. I guess other C compilers could do it differently, and not use the disk. In any case, the act of writing the file to the disk is transparent to the user, unless the option to preserve it is given. This transparency is provided by gcc; it runs the preprocessor on _all_ files (as required by the C standard), and it knows the naming conventions for the original and preprocessed files. In GNAT, the use of preprocessed files is not so transparent, because gnatmake does not know how to run the preprocessor. In addition, you need different naming conventions for the original and preprocessed files. If the preprocessed files follow the GNAT convention (the simplest choice), then the editing environment (Emacs or GPS or AdaGIDE) will still not understand the naming convention for the original files. With a proper makefile, you can run the GNAT preprocessor on _all_ files. If you use the GNAT default naming convention for the original files (so the editor works nicely), and tell GNAT to use an alternate naming convention for the preprocessed files (via project files), using the GNAT preprocessor will be as transparent as using the Gnu C preprocessor. -- -- Stephe