msg_156.c revision 1.7
1/* $NetBSD: msg_156.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */ 2# 3 "msg_156.c" 3 4// Test for message: function expects '%s', passing '%s' for arg #%d [156] 5 6enum color { 7 RED = 1 << 0, 8 GREEN = 1 << 1, 9 BLUE = 1 << 2 10}; 11 12enum size { 13 SMALL, 14 MEDIUM, 15 LARGE 16}; 17 18void print_color(enum color); 19 20void 21example(enum color c, enum size s) 22{ 23 print_color(GREEN); 24 print_color(c); 25 26 /* expect+1: warning: function expects 'enum color', passing 'enum size' for arg #1 [156] */ 27 print_color(MEDIUM); 28 /* expect+1: warning: function expects 'enum color', passing 'enum size' for arg #1 [156] */ 29 print_color(s); 30} 31