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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c6546cb6e04b1761 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: __FILE__ and __LINE__ Date: 1997/04/07 Message-ID: #1/1 X-Deja-AN: 231294924 References: <5ia77f$go3@nlrgup.nlr.nl> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-04-07T00:00:00+00:00 List-Id: << 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