File tree Expand file tree Collapse file tree
tests/usr.bin/xlint/lint1 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- /* $NetBSD: msg_132.c,v 1.52 2025/01/02 20:02:59 rillig Exp $ */
1+ /* $NetBSD: msg_132.c,v 1.53 2025/01/03 01:27:35 rillig Exp $ */
22# 3 "msg_132.c"
33
44// Test for message: conversion from '%s' to '%s' may lose accuracy [132]
@@ -424,8 +424,6 @@ test_ic_minus(void)
424424
425425 ptr = ptr - 3 ;
426426 s64 = ptr + 3 - ptr ;
427- /* expect+1: warning: conversion from 'long' to 'unsigned int' may lose accuracy [132] */
428- u32 = ptr + 3 - ptr ;
429427}
430428
431429void
Original file line number Diff line number Diff line change 1- /* $NetBSD: msg_132_lp64.c,v 1.2 2023/07/07 19:45:22 rillig Exp $ */
1+ /* $NetBSD: msg_132_lp64.c,v 1.3 2025/01/03 01:27:35 rillig Exp $ */
22# 3 "msg_132_lp64.c"
33
44// Test for message: conversion from '%s' to '%s' may lose accuracy [132]
55
66/* lint1-extra-flags: -a -X 351 */
77/* lint1-only-if: lp64 */
88
9+ typedef unsigned int u32_t ;
10+
11+ u32_t u32 ;
12+ const char * ptr ;
13+
914unsigned int
10- convert_pointer_to_smaller_integer (void * ptr )
15+ convert_pointer_to_smaller_integer (void )
1116{
1217 /* expect+1: warning: conversion from 'unsigned long' to 'unsigned int' may lose accuracy [132] */
1318 return (unsigned long )(ptr ) >> 12 ;
1419}
20+
21+ void
22+ test_ic_minus (void )
23+ {
24+ /* expect+1: warning: conversion from 'long' to 'unsigned int' may lose accuracy [132] */
25+ u32 = ptr + 3 - ptr ;
26+ }
You can’t perform that action at this time.
0 commit comments