comp.lang.ada
 help / color / mirror / Atom feed
From: Keith Thompson <kst-u@mib.org>
Subject: Re: C Macros and their equivalent in Ada
Date: Wed, 10 Sep 2008 12:22:06 -0700
Date: 2008-09-10T12:22:06-07:00	[thread overview]
Message-ID: <lniqt3iz6p.fsf@nuthaus.mib.org> (raw)
In-Reply-To: 11ad88c5-e158-4718-9fbd-cd3ba5a76627@l64g2000hse.googlegroups.com

Maciej Sobczak <see.my.homepage@gmail.com> 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  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"



  parent reply	other threads:[~2008-09-10 19:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09 10:43 C Macros and their equivalent in Ada RasikaSrinivasan
2008-09-09 13:45 ` Colin Paul Gloster
2008-09-09 16:33   ` Ray Blaak
2008-09-09 18:54     ` RasikaSrinivasan
2008-09-10  0:16       ` Ray Blaak
2008-09-09 14:11 ` Jeffrey R. Carter
2008-09-09 14:39 ` Ludovic Brenta
2008-09-09 20:57   ` Maciej Sobczak
2008-09-10  6:57     ` Per Sandberg
2008-09-10 19:22     ` Keith Thompson [this message]
2008-09-09 15:11 ` Adam Beneschan
2008-09-13  3:33 ` Steve
replies disabled

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