This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
do { .... } while 0;
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- To: Erwin Ingris <erwiningris at yahoo dot com dot au>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 12 Jul 2002 12:42:56 +0100 (BST)
- Subject: do { .... } while 0;
- References: <20020712113507.59244.qmail@web40305.mail.yahoo.com>
Try:
#define FOO(C) \
{ \
return C; \
}
#define FOO(C) \
do \
{ \
return C; \
} \
while (0)
extern int a, b, c;
int main ()
{
if (a = b)
FOO(c);
else
return a;
}
with both versions of FOO.
Andrew.