This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Newline inside macro expansion
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: "Bansidhar Arvind Deshpande - CTD, Chennai."<bansidhara at ctd dot hcltech dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 14 Dec 2003 09:18:38 -0800
- Subject: Re: Newline inside macro expansion
- References: <32DAFCBE50B9974D82DCE268AF8B74CD0898A4@kavithai.ctd.hcltech.com>
"Bansidhar Arvind Deshpande - CTD, Chennai." <bansidhara@ctd.hcltech.com> writes:
> Hi all,
>
> This may be simple C preprocessor question.
>
> I want to write a macro which should have '\n' in its expansion.
Sorry, this is impossible. However, in the example you give
> if(a == param1)
> b = param2;
the C compiler does not care if it appears entirely on one line:
if (a == param1) b = param2;
so you can just define the macro in the obvious fashion. If this is
some language other than C, where newlines are significant, you should
use a different preprocessor. M4 for instance.
zw