1 1.5 rillig /* $NetBSD: d_gcc_compound_statements1.c,v 1.5 2021/06/19 15:51:11 rillig Exp $ */ 2 1.2 rillig # 3 "d_gcc_compound_statements1.c" 3 1.2 rillig 4 1.4 rillig /* GCC compound statement with expression */ 5 1.1 jruoho 6 1.1 jruoho foo(unsigned long z) 7 1.1 jruoho { 8 1.3 rillig z = ({ 9 1.3 rillig unsigned long tmp; 10 1.3 rillig tmp = 1; 11 1.3 rillig tmp; 12 1.3 rillig }); 13 1.1 jruoho foo(z); 14 1.1 jruoho } 15 1.5 rillig 16 1.5 rillig /* 17 1.5 rillig * Compound statements are only allowed in functions, not at file scope. 18 1.5 rillig * 19 1.5 rillig * Before decl.c 1.186 from 2021-06-19, lint crashed with a segmentation 20 1.5 rillig * fault. 21 1.5 rillig */ 22 1.5 rillig int c = ({ 23 1.5 rillig return 3; /* expect: return outside function */ 24 1.5 rillig }); /* expect: cannot initialize 'int' from 'void' */ 25