xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_004.c (revision cd4ee416b8ecb6a5d3739b2d808bd6e8e4173867)
1 /*	$NetBSD: msg_004.c,v 1.9 2024/11/30 11:27:20 rillig Exp $	*/
2 # 3 "msg_004.c"
3 
4 // Test for message: illegal type combination [4]
5 //
6 // See also:
7 //	msg_005.c
8 
9 /* lint1-extra-flags: -X 351 */
10 
11 // Lint does not detect "two or more data types", but GCC does.
12 signed double signed_double;
13 
14 int ok_int;
15 double ok_double;
16 float _Complex ok_float_complex;
17 
18 /* expect+2: error: invalid type for _Complex [308] */
19 /* expect+1: error: illegal type combination [4] */
20 int _Complex illegal_int_complex;
21 
22 char enum {
23 	CHAR
24 };
25 /* expect-1: error: illegal type combination [4] */
26 
27 long struct {
28 	int member;
29 };
30 /* expect-1: error: illegal type combination [4] */
31 
32 struct str {
33 };
34 /* expect+1: error: illegal type combination [4] */
35 struct str int struct_str_int;
36 
37 /* expect+1: error: illegal type combination [4] */
38 unsigned signed int unsigned_signed_int;
39 
40 /* expect+1: error: illegal type combination [4] */
41 unsigned unsigned int unsigned_unsigned_int;
42 
43 /* expect+1: error: illegal type combination [4] */
44 long long long int long_long_long_int;
45 
46 /* expect+1: error: illegal type combination [4] */
47 short double short_double;
48 
49 double short double_short;
50 
51 /* expect+1: error: illegal type combination [4] */
52 char double short char_double_short;
53