1*c83f7defSrillig /* $NetBSD: msg_344.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */ 22999d7a9Srillig # 3 "msg_344.c" 32999d7a9Srillig 42999d7a9Srillig // Test for message: bit-field of type plain 'int' has implementation-defined signedness [344] 52999d7a9Srillig 62999d7a9Srillig /* lint1-extra-flags: -p */ 72999d7a9Srillig 82999d7a9Srillig /* 92999d7a9Srillig * C90 3.5.2.1 allows 'int', 'signed int', 'unsigned int' as bit-field types. 102999d7a9Srillig * 112999d7a9Srillig * C99 6.7.2.1 significantly changed the wording of the allowable types for 122999d7a9Srillig * bit-fields. For example, 6.7.2.1p4 does not mention plain 'int' at all. 132999d7a9Srillig * The rationale for C99 6.7.2.1 mentions plain 'int' though, and it would 142999d7a9Srillig * have broken a lot of existing code to disallow plain 'int' as a bit-field 152999d7a9Srillig * type. Footnote 104 explicitly mentions plain 'int' as well and it even 162999d7a9Srillig * allows typedef-types for bit-fields. 172999d7a9Srillig */ 182999d7a9Srillig struct example { 19*c83f7defSrillig /* expect+1: warning: bit-field of type plain 'int' has implementation-defined signedness [344] */ 202999d7a9Srillig int plain_int: 1; 212999d7a9Srillig 222999d7a9Srillig signed int signed_int: 1; 232999d7a9Srillig unsigned int unsigned_int: 1; 242999d7a9Srillig }; 25