fr.comp.lang.c
  Home FAQ Contact Sign in
fr.comp.lang.c only
 
Advanced search
December 2006
motuwethfrsasuw
    123 48
45678910 49
11121314151617 50
18192021222324 51
25262728293031 52
2006
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
fr.comp.lang.c Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  To the preprocessor experts         


Author: ludovicd
Date: Dec 25, 2006 07:45

Hi,

As many, I'm looking for a more efficient use of the C preprocessor.
The gcc manual specifies:

"The macro's body ends at the end of the `#define' line. You may
continue the definition onto multiple lines, if necessary, using
backslash-newline. When the macro is expanded, however, it will all
come out on one line. For example,

#define NUMBERS 1, \
2, \
3
int x[] = { NUMBERS };
==> int x[] = { 1, 2, 3 };

The most common visible consequence of this is surprising line numbers
in error messages.

There is no restriction on what can go in a macro body provided it
decomposes into valid preprocessing tokens. Parentheses need not
balance, and the body need not resemble valid C code. (If it does not,
you may get error messages from the C compiler when you use the macro.)
"
Show full article (1.81Kb)
no comments