With gcc
, the following is a valid C statement:
foo ({bar(1); baz = 2;})
Which is equivalent to
bar(1);
baz = 2;
foo(2);
Edited: Here are my (hopefully more informative) questions:
- Was the ISO C standard committee/body petitioned to make these part of the C standard?
- If it was, was it before C99? Before C11? Later?
- What were the reasons given or suggested for not adopting this as part of the language?
- Is there some large pitfall or drawback to using this construct which I'm not aware of?