[comp.lang.c] __LINE__

diamond@tkou02.enet.dec.com (diamond@tkovoa) (05/09/90)

In article <1990May8.183211.2661@mdivax1.uucp> mdivax1!robinson (Jim Robinson) writes:
>In article <801@oz.rci.dk> kc@oz.rci.dk (Knud Christensen) writes:
>>...
>>#  define DTRACE fprintf(stderr, "Trace line %d\n", __LINE__)
>>...
>Isn't the use of __LINE__ non-portable?

In ANSI, __LINE__ may be used this way and the implementation has to make
the correct substitution (and the program may not #define or #undefine
__LINE__).  So the answer is almost "No, it is portable."
However, the correct answer is "Yes, there still aren't many ANSI-conformant
compilers yet."

-- 
Norman Diamond, Nihon DEC     diamond@tkou02.enet.dec.com
This_blank_intentionally_left_underlined________________________________________