fork download
/*
 * For http://stackoverflow.com/a/15448781/545027
 *   -- Eldar
 */

#define __type_is_void(expr) __builtin_types_compatible_p(typeof(expr), void)
#define __expr_or_zero(expr) __builtin_choose_expr(__type_is_void(expr), 0, (expr))

#define DO(expr) \
    __builtin_choose_expr(__type_is_void(expr), \
		__DO_VOID(expr), \
		__DO(__expr_or_zero(expr)))

#define __DO(expr) \
	({ typeof(expr) __ret; __ret = (expr); __ret; })

#define __DO_VOID(expr) \
	(void) (expr)

void foo(void) { }
int bar(void) { return 1; }

int main(void) {
	DO(foo());
	DO(bar());
	return 0;
}
Success #stdin #stdout 0s 1828KB
stdin
Standard input is empty
stdout

Standard output is empty