[comp.lang.c] macors and semicolons

gwyn@smoke.brl.mil (Doug Gwyn) (06/24/91)

In article <1991Jun24.213932.595@otago.ac.nz> andrew@otago.ac.nz writes:
>#define SWAP(a, b) {int c;  c = a; a = b; b = c}
>how do I define a swap macro that swaps two doubles, allows the ';' on the end
>of the macro call, but does not cause a systax error when used in this context?

This is not a C standards question.

One obvious general solution is:
	#define MACRO(args) do { /*...*/ } while(0)