Home | History | Annotate | Line # | Download | only in lint1
msg_245.c revision 1.5
      1  1.5  rillig /*	$NetBSD: msg_245.c,v 1.5 2022/06/16 21:24:41 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.3  rillig typedef struct tag_and_typedef_tag {
      7  1.3  rillig 	int member;
      8  1.3  rillig } tag_and_typedef_typedef;
      9  1.3  rillig 
     10  1.3  rillig struct only_tag {
     11  1.3  rillig 	int member;
     12  1.3  rillig };
     13  1.3  rillig 
     14  1.3  rillig typedef struct {
     15  1.3  rillig 	int member;
     16  1.3  rillig } only_typedef;
     17  1.3  rillig 
     18  1.3  rillig struct {
     19  1.3  rillig 	int member;
     20  1.3  rillig } unnamed;
     21  1.3  rillig 
     22  1.3  rillig void sink_bool(_Bool);
     23  1.3  rillig 
     24  1.3  rillig void
     25  1.3  rillig example(tag_and_typedef_typedef both,
     26  1.3  rillig 	only_typedef only_typedef,
     27  1.3  rillig 	struct only_tag only_tag)
     28  1.3  rillig {
     29  1.5  rillig 	/* expect+1: warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct only_tag' [245] */
     30  1.5  rillig 	sink_bool(&both == &only_tag);
     31  1.5  rillig 	/* expect+1: warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct typedef only_typedef' [245] */
     32  1.5  rillig 	sink_bool(&both == &only_typedef);
     33  1.5  rillig 	/* expect+1: warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct <unnamed>' [245] */
     34  1.5  rillig 	sink_bool(&both == &unnamed);
     35  1.3  rillig }
     36