msg_204.c revision 1.2
11.2Srillig/* $NetBSD: msg_204.c,v 1.2 2021/01/08 01:40:03 rillig Exp $ */ 21.1Srillig# 3 "msg_204.c" 31.1Srillig 41.1Srillig// Test for message: controlling expressions must have scalar type [204] 51.1Srillig 61.2Srilligextern void 71.2Srilligextern_function(void); 81.2Srillig 91.2Srilligvoid (*function_pointer)(void); 101.2Srillig 111.2Srillig/* 121.2Srillig * Since func.c 1.39 from 2020-12-31 18:51:28, lint had produced an error 131.2Srillig * when a controlling expression was a function. Pointers to functions were 141.2Srillig * ok though. 151.2Srillig */ 161.2Srilligvoid 171.2Srilligbug_between_2020_12_31_and_2021_01_08(void) 181.2Srillig{ 191.2Srillig if (extern_function) 201.2Srillig extern_function(); 211.2Srillig 221.2Srillig /* 231.2Srillig * FIXME: For some reason, the ampersand is discarded in 241.2Srillig * build_ampersand. This only has a visible effect if the 251.2Srillig * t_spec in check_controlling_expression is evaluated too early, 261.2Srillig * as has been the case before func.c 1.52 from 2021-01-08. 271.2Srillig */ 281.2Srillig if (&extern_function) 291.2Srillig extern_function(); 301.2Srillig 311.2Srillig /* This one has always been ok since pointers are scalar types. */ 321.2Srillig if (function_pointer) 331.2Srillig function_pointer(); 341.2Srillig} 35