[ create a new paste ] login | about

Link: http://codepad.org/2zKnbtkR    [ raw code | output | fork | 1 comment ]

RogerPate - C, pasted on Feb 9:
1
2
3
4
5
6
#define IF(cond,block) if ((cond)) block

int main() {
  IF(1,{ int a, b; })
  return 0;
}


Output:
1
2
3
4
5
6
Line 20: error: macro "IF" passed 3 arguments, but takes just 2
In function 'main':
Line 6: error: 'IF' undeclared (first use in this function)
Line 6: error: (Each undeclared identifier is reported only once
Line 6: error: for each function it appears in.)
Line 7: error: expected ';' before 'return'


Create a new paste based on this one


Comments:
posted by RogerPate on Feb 9
reply