xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_218.c (revision aef5eb5f59cdfe8314f1b5f78ac04eb144e44010)
1 /*	$NetBSD: msg_218.c,v 1.4 2022/06/22 19:23:18 rillig Exp $	*/
2 # 3 "msg_218.c"
3 
4 // Test for message: ANSI C treats constant as unsigned, op '%s' [218]
5 
6 /* lint1-only-if: ilp32 */
7 
8 void sink_int(int);
9 
10 /* All platforms supported by lint have 32-bit int in two's complement. */
11 void
12 test_signed_int(void)
13 {
14 	/* expect+2: warning: ANSI C treats constant as unsigned, op '-' [218] */
15 	/* expect+1: warning: conversion of 'unsigned long' to 'int' is out of range, arg #1 [295] */
16 	sink_int(-2147483648);
17 }
18