__LINE__ (was #define DEBUG...)

diamond@tkovoa diamond at tkou02.enet.dec.com
Wed May 9 19:47:33 AEST 1990


In article <1990May8.183211.2661 at mdivax1.uucp> mdivax1!robinson (Jim Robinson) writes:
>In article <801 at oz.rci.dk> kc at 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 at tkou02.enet.dec.com
This_blank_intentionally_left_underlined________________________________________



More information about the Comp.unix.wizards mailing list