fork(4) download
  1. #include <stdio.h>
  2.  
  3. #define MYMACRO(x) if (1) { x; } else (void)0
  4.  
  5. int main(void)
  6. {
  7. int x = 0;
  8.  
  9. if (x == 0)
  10. MYMACRO( x = 2; x *= 6; ) // <--- compile error, no semicolon
  11. else
  12. x = -1;
  13.  
  14. printf("result is %d\n", x);
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
result is 12