1<html lang="en"> 2<head> 3<title>Newlines in Arguments - The C Preprocessor</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="The C Preprocessor"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Macro-Pitfalls.html#Macro-Pitfalls" title="Macro Pitfalls"> 9<link rel="prev" href="Argument-Prescan.html#Argument-Prescan" title="Argument Prescan"> 10<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 11<!-- 12Copyright (C) 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 131997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 142008, 2009, 2010, 2011 15Free Software Foundation, Inc. 16 17Permission is granted to copy, distribute and/or modify this document 18under the terms of the GNU Free Documentation License, Version 1.3 or 19any later version published by the Free Software Foundation. A copy of 20the license is included in the 21section entitled ``GNU Free Documentation License''. 22 23This manual contains no Invariant Sections. The Front-Cover Texts are 24(a) (see below), and the Back-Cover Texts are (b) (see below). 25 26(a) The FSF's Front-Cover Text is: 27 28 A GNU Manual 29 30(b) The FSF's Back-Cover Text is: 31 32 You have freedom to copy and modify this GNU Manual, like GNU 33 software. Copies published by the Free Software Foundation raise 34 funds for GNU development. 35--> 36<meta http-equiv="Content-Style-Type" content="text/css"> 37<style type="text/css"><!-- 38 pre.display { font-family:inherit } 39 pre.format { font-family:inherit } 40 pre.smalldisplay { font-family:inherit; font-size:smaller } 41 pre.smallformat { font-family:inherit; font-size:smaller } 42 pre.smallexample { font-size:smaller } 43 pre.smalllisp { font-size:smaller } 44 span.sc { font-variant:small-caps } 45 span.roman { font-family:serif; font-weight:normal; } 46 span.sansserif { font-family:sans-serif; font-weight:normal; } 47--></style> 48<link rel="stylesheet" type="text/css" href="../cs.css"> 49</head> 50<body> 51<div class="node"> 52<a name="Newlines-in-Arguments"></a> 53<p> 54Previous: <a rel="previous" accesskey="p" href="Argument-Prescan.html#Argument-Prescan">Argument Prescan</a>, 55Up: <a rel="up" accesskey="u" href="Macro-Pitfalls.html#Macro-Pitfalls">Macro Pitfalls</a> 56<hr> 57</div> 58 59<h4 class="subsection">3.10.7 Newlines in Arguments</h4> 60 61<p><a name="index-newlines-in-macro-arguments-82"></a> 62The invocation of a function-like macro can extend over many logical 63lines. However, in the present implementation, the entire expansion 64comes out on one line. Thus line numbers emitted by the compiler or 65debugger refer to the line the invocation started on, which might be 66different to the line containing the argument causing the problem. 67 68 <p>Here is an example illustrating this: 69 70<pre class="smallexample"> #define ignore_second_arg(a,b,c) a; c 71 72 ignore_second_arg (foo (), 73 ignored (), 74 syntax error); 75</pre> 76 <p class="noindent">The syntax error triggered by the tokens <code>syntax error</code> results in 77an error message citing line three—the line of ignore_second_arg— 78even though the problematic code comes from line five. 79 80 <p>We consider this a bug, and intend to fix it in the near future. 81 82 </body></html> 83 84