Super User's BSD Cross Reference: /NetBSD/tests/usr.bin/xlint/lint1/msg_179.c

1 /* $NetBSD: msg_179.c,v 1.5 2023年03月28日 14:44:35 rillig Exp $ */
2# 3 "msg_179.c"
3
4 // Test for message: cannot initialize struct/union with no named member [179]
5
6 /* lint1-extra-flags: -X 351 */
7
8 struct {
9 unsigned int :0;
10} no_named_member = {
11 /* expect-1: error: cannot initialize struct/union with no named member [179] */
12 /* no named member, therefore no initializer expression */
13};
14
15 struct {
16 /* no members */
17} empty = {
18 /* expect-1: error: cannot initialize struct/union with no named member [179] */
19 /* no initializer expressions */
20};
21
22 struct {
23 unsigned int: 0;
24} no_named_member_init = {
25 /* expect-1: error: cannot initialize struct/union with no named member [179] */
26 3,
27};
28 

AltStyle によって変換されたページ (->オリジナル) /