Interesting, I just tried compiling this with gcc 4.4.5 and got no warnings:
#include <stdio.h>
#define ADD(x, y, z) \
do { \
z = x + y; \
} while (0)
int main(int argc, char *argv[])
{
int z;
ADD(1, 3, z);
printf("z = %d\n", z);
return 0;
}
If your compiler complains about the do{} while (0) construct in macros, I'd be inclined to treat it as a bug and complain to the vendor.