1 1.6 rillig /* $NetBSD: msg_245.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ 2 1.1 rillig # 3 "msg_245.c" 3 1.1 rillig 4 1.4 rillig // Test for message: incompatible structure pointers: '%s' '%s' '%s' [245] 5 1.1 rillig 6 1.6 rillig /* lint1-extra-flags: -X 351 */ 7 1.6 rillig 8 1.3 rillig typedef struct tag_and_typedef_tag { 9 1.3 rillig int member; 10 1.3 rillig } tag_and_typedef_typedef; 11 1.3 rillig 12 1.3 rillig struct only_tag { 13 1.3 rillig int member; 14 1.3 rillig }; 15 1.3 rillig 16 1.3 rillig typedef struct { 17 1.3 rillig int member; 18 1.3 rillig } only_typedef; 19 1.3 rillig 20 1.3 rillig struct { 21 1.3 rillig int member; 22 1.3 rillig } unnamed; 23 1.3 rillig 24 1.3 rillig void sink_bool(_Bool); 25 1.3 rillig 26 1.3 rillig void 27 1.3 rillig example(tag_and_typedef_typedef both, 28 1.3 rillig only_typedef only_typedef, 29 1.3 rillig struct only_tag only_tag) 30 1.3 rillig { 31 1.5 rillig /* expect+1: warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct only_tag' [245] */ 32 1.5 rillig sink_bool(&both == &only_tag); 33 1.5 rillig /* expect+1: warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct typedef only_typedef' [245] */ 34 1.5 rillig sink_bool(&both == &only_typedef); 35 1.5 rillig /* expect+1: warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct <unnamed>' [245] */ 36 1.5 rillig sink_bool(&both == &unnamed); 37 1.3 rillig } 38