1/* $NetBSD: msg_022.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ 2# 3 "msg_022.c" 3 4// Test for message: incomplete or misplaced function definition [22] 5 6/* lint1-extra-flags: -X 351 */ 7 8/* 9 * Before decl.c 1.264 and func.c 1.130 from 2022-04-02, lint ran into 10 * assertion failures after trying to recover from the below syntax error. 11 */ 12/* expect+1: error: syntax error 'f' [249] */ 13unsigned long asdf = sizeof(int f() {}); 14 15/* Give the parser a chance to recover. */ 16/* expect+1: warning: empty declaration [0] */ 17; 18 19/* 20 * Before decl.c 1.264 and func.c 1.130 from 2022-04-02, lint ran into 21 * assertion failures after trying to recover from the below syntax error. 22 */ 23/* expect+1: error: syntax error 'param1' [249] */ 24unsigned long sz = sizeof(int(param1, param2)); 25 26/* Give the parser a chance to recover. */ 27/* expect+1: warning: empty declaration [0] */ 28; 29 30/* expect+2: error: incomplete or misplaced function definition [22] */ 31/* expect+1: warning: old-style declaration; add 'int' [1] */ 32old_style(arg); 33