Home | History | Annotate | Line # | Download | only in lint1
msg_192.c revision 1.8
      1 /*	$NetBSD: msg_192.c,v 1.8 2023/09/12 07:23:27 rillig Exp $	*/
      2 # 3 "msg_192.c"
      3 
      4 // Test for message: '%s' unused in function '%s' [192]
      5 
      6 /* lint1-extra-flags: -X 351 */
      7 
      8 void
      9 /* expect+1: warning: parameter 'param' unused in function 'example' [231] */
     10 example(int param)
     11 {
     12 	/* expect+1: warning: 'local' unused in function 'example' [192] */
     13 	int local;
     14 }
     15 
     16 
     17 void assertion_failed(const char *);
     18 
     19 /*
     20  * The symbol '__func__' only occurs in an unreachable branch.  It is
     21  * nevertheless marked as used.
     22  */
     23 void
     24 assert_true(void)
     25 {
     26 	sizeof(char) == 1
     27 	    ? (void)0
     28 	    : assertion_failed(__func__);
     29 }
     30 
     31 void
     32 assert_false(void)
     33 {
     34 	sizeof(char) == 0
     35 	    ? (void)0
     36 	    : assertion_failed(__func__);
     37 }
     38 
     39 void
     40 assert_unknown(_Bool cond)
     41 {
     42 	cond
     43 	    ? (void)0
     44 	    : assertion_failed(__func__);
     45 }
     46