blob: d9786af0e354bada11e5198da65c6a315ec98efb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
/* $NetBSD: decl_struct_member.c,v 1.17 2023/05/22 12:55:04 rillig Exp $ */
# 3 "decl_struct_member.c"
/* lint1-extra-flags: -X 351 */
struct multi_attributes {
__attribute__((deprecated))
__attribute__((deprecated))
__attribute__((deprecated))
int deprecated;
};
struct cover_begin_type_specifier_qualifier_list {
int m1;
__attribute__((deprecated)) int m2;
const int m3;
int const m4;
int const long m5;
int __attribute__((deprecated)) m6;
};
typedef int number;
struct cover_begin_type_typespec {
int m1;
number m2;
};
struct cover_begin_type_qualifier_list {
const m1;
const volatile m2;
};
/* cover struct_or_union_specifier: struct_or_union error */
/* expect+1: error: syntax error 'goto' [249] */
struct goto {
/* expect+1: error: illegal type combination [4] */
int member;
/* expect+1: error: syntax error '}' [249] */
};
/* expect-1: warning: empty declaration [0] */
/*
* Before cgram.y 1.228 from 2021-06-19, lint ran into an assertion failure:
*
* "is_struct_or_union(dcs->d_type->t_tspec)" at cgram.y:846
*/
struct {
/* expect+1: error: syntax error 'unnamed member' [249] */
char;
};
struct cover_notype_struct_declarators {
const a, b;
};
struct cover_notype_struct_declarator_bit_field {
const a:3, :0, b:4;
const:0;
};
/*
* An array of bit-fields sounds like a strange idea since a bit-field member
* is not addressable, while an array needs to be addressable. Due to this
* contradiction, this combination may have gone without mention in the C
* standards.
*
* GCC 10.3.0 complains that the bit-field has invalid type.
*
* Clang 12.0.1 complains that the bit-field has non-integral type 'unsigned
* int [8]'.
*/
struct array_of_bit_fields {
/* expect+1: warning: illegal bit-field type 'array[8] of unsigned int' [35] */
unsigned int bits[8]: 1;
};
/*
* Before decl.c 1.188 from 2021-06-20, lint ran into a segmentation fault.
*/
struct {
/* expect+1: error: syntax error '0' [249] */
char a(_)0
/*
* Before cgram.y 1.328 from 2021-07-15, lint ran into an assertion failure
* at the closing semicolon:
*
* assertion "t == NO_TSPEC" failed in end_type at decl.c:774
*/
};
/* expect+1: error: cannot recover from previous errors [224] */
|