This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
A question about macro replacement
- From: <zhao_bingfeng at topsec dot com dot cn>
- To: <gcc at gcc dot gnu dot org>
- Date: Wed, 7 Feb 2007 17:32:08 +0800
- Subject: A question about macro replacement
- Reply-to: <zhao_bingfeng at topsec dot com dot cn>
Hi, all,
With following code:
[CODE]
struct B {
int c;
int d;
};
#define X(a, b, c) \
do\
{\
if (a)\
printf("%d, %d\n", b.c, c);\
else\
printf("%d\n", c);\
}while(0);
[/CODE]
Why
int d = 24;
X(1, b, d);
can be compiled successfully but
X(1, b, 24);
not.
I cannot find any description about this behavior in C standard.