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,f0aecf9351d714ac X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news.glorb.com!news.motzarella.org!motzarella.org!not-for-mail From: Keith Thompson Newsgroups: comp.lang.ada Subject: Re: C Macros and their equivalent in Ada Date: Wed, 10 Sep 2008 12:22:06 -0700 Organization: None to speak of Message-ID: References: <90d69a98-ab81-45b2-bd0e-18675b327b66@d77g2000hsb.googlegroups.com> <11ad88c5-e158-4718-9fbd-cd3ba5a76627@l64g2000hse.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: feeder.motzarella.org U2FsdGVkX18AYBoIOaEMwBwjFpz38qMijFB9aX2LrSWBVGuhuilWMdEcEBYkYKEfQ8DRj0bOhlu6aeFQ9XEVJZwSBaVdDzJxNsviHtgS97bc0sSRo1KJO9L8DDifK1GV10PRXtN9m1Q= X-Complaints-To: Please send complaints to abuse@motzarella.org with full headers NNTP-Posting-Date: Wed, 10 Sep 2008 19:22:08 +0000 (UTC) X-Auth-Sender: U2FsdGVkX1+98J3XbOlyQ4VRlSzwfo8U Cancel-Lock: sha1:wIRBff5TaDZQSgFBCLraVq2kCVU= sha1:6F1pdMxWn/dwHmA6KfipsAfl2QE= User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (gnu/linux) Xref: g2news2.google.com comp.lang.ada:7697 Date: 2008-09-10T12:22:06-07:00 List-Id: Maciej Sobczak writes: [...] > The other extremely useful macros from the C world are __FILE__ and > __LINE__. I'm afraid there is no way to simulate them using any > external solutions, short of using the real preprocessor (why not?). > > Yeah - why not use the cpp preprocessor? [...] The cpp preprocessor is designed to be used with C and C++. For example, the apostrophe character in C, if it appears outside a string literal, is used only as a delimiter for a character constant. If you have a single apostrophe on a line because you're using an Ada qualified expression or attribute, or even in an Ada comment (the leading -- will be treated as an operator symbol), then cpp is likely to complain or even terminate. One implementation I just tried issued a warning message and continued processing, but that's not guaranteed. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Nokia "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"