comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: __FILE__ and __LINE__
Date: 1997/04/07
Date: 1997-04-07T00:00:00+00:00	[thread overview]
Message-ID: <dewar.860416526@merv> (raw)
In-Reply-To: 5ia77f$go3@nlrgup.nlr.nl


<<    I am looking for Ada equivalents for the C preprocessor macros
"__FILE__" and "__LINE__", which result in the source file name
(constant string) and the line number (integer) of the file/position
they are specified, respectively. As far as I know there are no
pragma's in Ada 95 or GNAT 3.x that do similar things. Maybe there are
other means to do the same ? Or is this impossible in Ada 95 ?>>

There is no predefined way of doing this in Ada 95, and indeed it is highly
implementation dependent by definition (what is a "source file name"?)

It would be easy to implement an attribute (not a pragma, I don't see how
a pragma would work) that would provide this information, e.g.

Standard'Line
Standard'File

(applying attributes to Standard in such a case is an existing trick in
 GNAT for defining new attributes)

or you could, perhaps more cleanly, have two intrinsic functions in a 
library routine.

However, none of our customers has requested such a feature, so it is not
on our priority radar screen at the moment ....

Robert Dewar
Ada Core Technologies





  parent reply	other threads:[~1997-04-07  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-07  0:00 __FILE__ and __LINE__ Carl G.M. Welman
1997-04-07  0:00 ` David C. Hoos, Sr.
1997-04-07  0:00 ` Robert Dewar [this message]
1997-04-08  0:00   ` Carl G.M. Welman
1997-04-08  0:00     ` Robert Dewar
1997-04-09  0:00   ` Fergus Henderson
replies disabled

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