GNU Info

Info Node: (cpp-300.info)Newlines in Arguments

(cpp-300.info)Newlines in Arguments


Prev: Argument Prescan Up: Macro Pitfalls
Enter node , (file) or (file)node

Newlines in Arguments
---------------------

   The invocation of a function-like macro can extend over many logical
lines.  However, in the present implementation, the entire expansion
comes out on one line.  Thus line numbers emitted by the compiler or
debugger refer to the line the invocation started on, which might be
different to the line containing the argument causing the problem.

   Here is an example illustrating this:

     #define ignore_second_arg(a,b,c) a; c
     
     ignore_second_arg (foo (),
                        ignored (),
                        syntax error);

The syntax error triggered by the tokens `syntax error' results in an
error message citing line three--the line of ignore_second_arg-- even
though the problematic code comes from line five.

   We consider this a bug, and intend to fix it in the near future.


automatically generated by info2www version 1.2.2.9