msg_215.c revision 1.12 1 1.12 rillig /* $NetBSD: msg_215.c,v 1.12 2022/06/22 19:23:18 rillig Exp $ */
2 1.1 rillig # 3 "msg_215.c"
3 1.1 rillig
4 1.7 rillig // Test for message: function '%s' implicitly declared to return int [215]
5 1.1 rillig
6 1.4 rillig /*
7 1.4 rillig * In traditional C and C90, it was possible to implicitly declare a function
8 1.4 rillig * by just calling it, without defining a prototype first. Such a function
9 1.4 rillig * would then be defined as taking unspecified parameters and returning int.
10 1.4 rillig */
11 1.4 rillig
12 1.4 rillig struct str {
13 1.4 rillig int dummy;
14 1.4 rillig };
15 1.4 rillig
16 1.4 rillig /* ARGSUSED */
17 1.3 rillig void
18 1.10 rillig test(struct str str, const double *p_double)
19 1.3 rillig {
20 1.11 rillig /* expect+1: error: function 'name' implicitly declared to return int [215] */
21 1.4 rillig name();
22 1.4 rillig
23 1.6 rillig /* expect+2: error: 'parenthesized' undefined [99] */
24 1.12 rillig /* expect+1: error: cannot call 'int', must be a function [149] */
25 1.6 rillig (parenthesized)();
26 1.6 rillig
27 1.5 rillig /* expect+2: error: type 'struct str' does not have member 'member' [101] */
28 1.12 rillig /* expect+1: error: cannot call 'int', must be a function [149] */
29 1.4 rillig str.member();
30 1.9 rillig
31 1.9 rillig /* https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html */
32 1.9 rillig __builtin_whatever(123, "string");
33 1.9 rillig __atomic_whatever(123, "string");
34 1.10 rillig /* obsolete but still in use, as of 2021 */
35 1.10 rillig __sync_whatever(123, "string");
36 1.10 rillig
37 1.10 rillig /* https://software.intel.com/sites/landingpage/IntrinsicsGuide/ */
38 1.10 rillig _mm_load_sd(p_double);
39 1.3 rillig }
40