pardo@june.cs.washington.edu (David Keppel) (02/24/89)
The following program causes the cpp error message to have line zero instead of, say, the line of ``invocation'' of the macro. MACHINE: VAX 8550, Ultrix 2.3 GCC: 1.30, built using configuration shell script. Repeat by: :::::::::::::: main.c :::::::::::::: #define AMACRO(arg) foo(arg) #ifdef LINT extern int ZERO; #else # define ZERO 0 #endif #define STMT(s) do { s } while (ZERO) #define BUG(arg) \ STMT( AMACRO((arg); ) /* ^ this is a bug! */ void foo (int arg) { ; } int main (void) { int x; foo (x); /* Is this it? */ BUG(x); /* Or is this it? */ BUG(x); } :::::::::::::: gcc -g -ansi -v -W -Wimplicit -Wreturn-type -c main.c :::::::::::::: gcc version 1.30 /uns/src/GNU/g++/lib/gcc-cpp -v -undef -D__GNU__ -D__GNUC__ -T -$ -D__STRICT_ANSI__ main.c /tmp/cc011961.cpp GNU CPP version 1.30 main.c:0: unterminated macro call main.c:38: only 0 args to macro `STMT' *** Error code 1 :::::::::::::: End :::::::::::::: ;-D on ( Error messages named after quarks ) Pardo -- pardo@cs.washington.edu {rutgers,cornell,ucsd,ubc-cs,tektronix}!uw-beaver!june!pardo