Home | History | Annotate | Line # | Download | only in lint1
msg_107.c revision 1.7
      1  1.7  rillig /*	$NetBSD: msg_107.c,v 1.7 2024/01/07 21:19:42 rillig Exp $	*/
      2  1.1  rillig # 3 "msg_107.c"
      3  1.1  rillig 
      4  1.4  rillig // Test for message: operands of '%s' have incompatible types '%s' and '%s' [107]
      5  1.1  rillig 
      6  1.6  rillig /* lint1-extra-flags: -X 351 */
      7  1.6  rillig 
      8  1.3  rillig /* ARGSUSED */
      9  1.3  rillig void
     10  1.3  rillig compare(double d, void *ptr)
     11  1.3  rillig {
     12  1.5  rillig 	/* expect+1: error: operands of '==' have incompatible types 'double' and 'pointer to void' [107] */
     13  1.3  rillig 	return d == ptr;
     14  1.3  rillig }
     15  1.7  rillig 
     16  1.7  rillig static inline void
     17  1.7  rillig typeok_minus(const char *p, int i, double d)
     18  1.7  rillig {
     19  1.7  rillig 	if (p[i] != p[(int)d])
     20  1.7  rillig 		return;
     21  1.7  rillig 	/* expect+1: error: operands of '-' have incompatible types 'pointer to const char' and 'double' [107] */
     22  1.7  rillig 	return (p - i) - (p - d);
     23  1.7  rillig }
     24