Module Name: src Committed By: rillig Date: Fri Apr 15 21:50:07 UTC 2022
Modified Files: src/tests/usr.bin/xlint/lint1: d_constant_conv2.c d_constant_conv2.exp d_type_conv1.c d_type_conv1.exp d_type_conv2.c d_type_conv2.exp d_type_conv3.c d_type_conv3.exp expr_fold.c expr_fold.exp msg_259.c msg_259_ilp32.c src/usr.bin/xlint/lint1: tree.c Log Message: lint: in C99 mode, do not warn about non-prototype conversions Message 259 is "argument #%d is converted from '%s' to '%s' due to prototype", and it is intended to warn about compatibility between traditional C where functions had no prototypes and standard C where functions have prototypes. Running lint in C99 mode is further away from traditional C than running lint in C90 mode, so that warning doesn't make sense for C99. There are still some inconsistencies in the 5 language version modes that lint offers: -t for traditional C (no option) for migrating traditional C to C90 -s for C90 code -S for C99 code -Ac11 for C11 code By disabling warning 259 in C99 mode, a typical NetBSD build produces 14.500 fewer warnings than before, of about 100.000 total. Message 259 overlaps with message 298 "conversion from '%s' to '%s' may lose accuracy, arg #%d", and in some cases of potentially lossy conversions, lint now produces none of these messages. In some other cases, these warnings were reported redundantly. The cases where message 298 makes sense will be added back later, as needed. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/d_constant_conv2.c \ src/tests/usr.bin/xlint/lint1/d_type_conv1.c \ src/tests/usr.bin/xlint/lint1/d_type_conv2.c cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp \ src/tests/usr.bin/xlint/lint1/d_type_conv1.exp \ src/tests/usr.bin/xlint/lint1/d_type_conv2.exp \ src/tests/usr.bin/xlint/lint1/d_type_conv3.exp cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/d_type_conv3.c \ src/tests/usr.bin/xlint/lint1/expr_fold.c \ src/tests/usr.bin/xlint/lint1/expr_fold.exp \ src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c cvs rdiff -u -r1.19 -r1.20 src/tests/usr.bin/xlint/lint1/msg_259.c cvs rdiff -u -r1.426 -r1.427 src/usr.bin/xlint/lint1/tree.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/d_constant_conv2.c diff -u src/tests/usr.bin/xlint/lint1/d_constant_conv2.c:1.4 src/tests/usr.bin/xlint/lint1/d_constant_conv2.c:1.5 --- src/tests/usr.bin/xlint/lint1/d_constant_conv2.c:1.4 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_constant_conv2.c Fri Apr 15 21:50:07 2022 @@ -1,12 +1,19 @@ -/* $NetBSD: d_constant_conv2.c,v 1.4 2022/01/15 14:22:03 rillig Exp $ */ +/* $NetBSD: d_constant_conv2.c,v 1.5 2022/04/15 21:50:07 rillig Exp $ */ # 3 "d_constant_conv2.c" /* Flag information-losing constant conversion in argument lists */ +/* + * Before tree.c 1.427 from 2022-04-15, lint warned about conversions due to + * prototype even in C99 mode, which is far away from traditional C to make + * non-prototype functions an issue. + */ +/* lint1-flags: -h -w */ + int f(unsigned int); void -should_fail() +should_fail(void) { /* expect+1: warning: argument #1 is converted from 'double' to 'unsigned int' due to prototype [259] */ f(2.1); Index: src/tests/usr.bin/xlint/lint1/d_type_conv1.c diff -u src/tests/usr.bin/xlint/lint1/d_type_conv1.c:1.4 src/tests/usr.bin/xlint/lint1/d_type_conv1.c:1.5 --- src/tests/usr.bin/xlint/lint1/d_type_conv1.c:1.4 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_type_conv1.c Fri Apr 15 21:50:07 2022 @@ -1,12 +1,19 @@ -/* $NetBSD: d_type_conv1.c,v 1.4 2022/01/15 14:22:03 rillig Exp $ */ +/* $NetBSD: d_type_conv1.c,v 1.5 2022/04/15 21:50:07 rillig Exp $ */ # 3 "d_type_conv1.c" /* Flag information-losing type conversion in argument lists */ +/* + * Before tree.c 1.427 from 2022-04-15, lint warned about conversions due to + * prototype even in C99 mode, which is far away from traditional C to make + * non-prototype functions an issue. + */ +/* lint1-flags: -g -h -w */ + int f(unsigned int); void -should_fail() +should_fail(void) { long long x = 20; Index: src/tests/usr.bin/xlint/lint1/d_type_conv2.c diff -u src/tests/usr.bin/xlint/lint1/d_type_conv2.c:1.4 src/tests/usr.bin/xlint/lint1/d_type_conv2.c:1.5 --- src/tests/usr.bin/xlint/lint1/d_type_conv2.c:1.4 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_type_conv2.c Fri Apr 15 21:50:07 2022 @@ -1,12 +1,19 @@ -/* $NetBSD: d_type_conv2.c,v 1.4 2022/01/15 14:22:03 rillig Exp $ */ +/* $NetBSD: d_type_conv2.c,v 1.5 2022/04/15 21:50:07 rillig Exp $ */ # 3 "d_type_conv2.c" /* Flag information-losing type conversion in argument lists */ +/* + * Before tree.c 1.427 from 2022-04-15, lint warned about conversions due to + * prototype even in C99 mode, which is far away from traditional C to make + * non-prototype functions an issue. + */ +/* lint1-flags: -h -w */ + int f(float); void -should_fail() +should_fail(void) { double x = 2.0; Index: src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp diff -u src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.6 src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.7 --- src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.6 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp Fri Apr 15 21:50:07 2022 @@ -1 +1 @@ -d_constant_conv2.c(12): warning: argument #1 is converted from 'double' to 'unsigned int' due to prototype [259] +d_constant_conv2.c(19): warning: argument #1 is converted from 'double' to 'unsigned int' due to prototype [259] Index: src/tests/usr.bin/xlint/lint1/d_type_conv1.exp diff -u src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.6 src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.7 --- src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.6 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_type_conv1.exp Fri Apr 15 21:50:07 2022 @@ -1 +1 @@ -d_type_conv1.c(14): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259] +d_type_conv1.c(21): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259] Index: src/tests/usr.bin/xlint/lint1/d_type_conv2.exp diff -u src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.6 src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.7 --- src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.6 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_type_conv2.exp Fri Apr 15 21:50:07 2022 @@ -1 +1 @@ -d_type_conv2.c(14): warning: argument #1 is converted from 'double' to 'float' due to prototype [259] +d_type_conv2.c(21): warning: argument #1 is converted from 'double' to 'float' due to prototype [259] Index: src/tests/usr.bin/xlint/lint1/d_type_conv3.exp diff -u src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.6 src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.7 --- src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.6 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_type_conv3.exp Fri Apr 15 21:50:07 2022 @@ -1,2 +1,2 @@ -d_type_conv3.c(14): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259] -d_type_conv3.c(14): warning: conversion of 'long long' to 'unsigned int' is out of range, arg #1 [295] +d_type_conv3.c(21): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259] +d_type_conv3.c(21): warning: conversion of 'long long' to 'unsigned int' is out of range, arg #1 [295] Index: src/tests/usr.bin/xlint/lint1/d_type_conv3.c diff -u src/tests/usr.bin/xlint/lint1/d_type_conv3.c:1.5 src/tests/usr.bin/xlint/lint1/d_type_conv3.c:1.6 --- src/tests/usr.bin/xlint/lint1/d_type_conv3.c:1.5 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_type_conv3.c Fri Apr 15 21:50:07 2022 @@ -1,12 +1,19 @@ -/* $NetBSD: d_type_conv3.c,v 1.5 2022/01/15 14:22:03 rillig Exp $ */ +/* $NetBSD: d_type_conv3.c,v 1.6 2022/04/15 21:50:07 rillig Exp $ */ # 3 "d_type_conv3.c" /* Flag information-losing type conversion in argument lists */ +/* + * Before tree.c 1.427 from 2022-04-15, lint warned about conversions due to + * prototype even in C99 mode, which is far away from traditional C to make + * non-prototype functions an issue. + */ +/* lint1-flags: -g -h -w */ + int f(unsigned int); void -should_fail() +should_fail(void) { /* expect+2: warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259] */ Index: src/tests/usr.bin/xlint/lint1/expr_fold.c diff -u src/tests/usr.bin/xlint/lint1/expr_fold.c:1.5 src/tests/usr.bin/xlint/lint1/expr_fold.c:1.6 --- src/tests/usr.bin/xlint/lint1/expr_fold.c:1.5 Mon Aug 23 06:50:01 2021 +++ src/tests/usr.bin/xlint/lint1/expr_fold.c Fri Apr 15 21:50:07 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: expr_fold.c,v 1.5 2021/08/23 06:50:01 rillig Exp $ */ +/* $NetBSD: expr_fold.c,v 1.6 2022/04/15 21:50:07 rillig Exp $ */ # 3 "expr_fold.c" /* @@ -29,20 +29,14 @@ fold_uplus(void) { take_int(+(0)); take_int(+(2147483647)); - /* XXX: one of these two messages is redundant */ - /* expect+2: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ /* expect+1: warning: conversion of 'long' to 'int' is out of range, arg #1 [295] */ take_int(+(2147483648)); - /* XXX: one of these two messages is redundant */ - /* expect+2: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ /* expect+1: warning: conversion of 'long' to 'int' is out of range, arg #1 [295] */ take_int(+(4294967295)); take_uint(+(0)); take_uint(+(2147483647)); - /* expect+1: warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] */ take_uint(+(2147483648)); - /* expect+1: warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] */ take_uint(+(4294967295)); /* @@ -60,11 +54,9 @@ fold_uminus(void) take_int(-(0)); take_int(-(2147483647)); - /* expect+1: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ take_int(-(2147483648)); /* The '-' is an operator, it is not part of the integer constant. */ - /* expect+1: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ take_int(-2147483648); /* expect+2: warning: integer overflow detected, op '+' [141] */ @@ -72,18 +64,14 @@ fold_uminus(void) take_int(-(2147483647 + 1)); /* expect+1: warning: integer overflow detected, op '-' [141] */ take_int(-(-2147483647 - 1)); - /* expect+2: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ /* expect+1: warning: conversion of 'long' to 'int' is out of range, arg #1 [295] */ take_int(-(4294967295)); take_uint(-(0)); - /* expect+2: warning: conversion of negative constant to unsigned type, arg #1 [296] */ - /* expect+1: warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259] */ + /* expect+1: warning: conversion of negative constant to unsigned type, arg #1 [296] */ take_uint(-(2147483647)); - /* expect+2: warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] */ /* expect+1: warning: conversion of negative constant to unsigned type, arg #1 [296] */ take_uint(-(2147483648)); - /* expect+2: warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] */ /* expect+1: warning: conversion of negative constant to unsigned type, arg #1 [296] */ take_uint(-(4294967295)); } @@ -93,23 +81,17 @@ fold_compl(void) { take_int(~(0)); take_int(~(2147483647)); - /* expect+2: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ /* expect+1: warning: conversion of 'long' to 'int' is out of range, arg #1 [295] */ take_int(~(2147483648)); - /* expect+2: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ /* expect+1: warning: conversion of 'long' to 'int' is out of range, arg #1 [295] */ take_int(~(4294967295)); - /* expect+2: warning: conversion of negative constant to unsigned type, arg #1 [296] */ - /* expect+1: warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259] */ + /* expect+1: warning: conversion of negative constant to unsigned type, arg #1 [296] */ take_uint(~(0)); - /* expect+2: warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259] */ /* expect+1: warning: conversion of negative constant to unsigned type, arg #1 [296] */ take_uint(~(2147483647)); - /* expect+2: warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] */ /* expect+1: warning: conversion of negative constant to unsigned type, arg #1 [296] */ take_uint(~(2147483648)); - /* expect+2: warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] */ /* expect+1: warning: conversion of negative constant to unsigned type, arg #1 [296] */ take_uint(~(4294967295)); } @@ -137,7 +119,6 @@ fold_div(void) /* expect+1: warning: integer overflow detected, op '/' [141] */ take_int(0 / 0); - /* expect+2: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ /* expect+1: warning: conversion of 'long' to 'int' is out of range, arg #1 [295] */ take_int(-2147483648 / -1); } @@ -154,7 +135,6 @@ fold_mod(void) /* expect+1: error: modulus by 0 [140] */ take_int(0U % 0U); - /* expect+1: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ take_int(-2147483648 % -1); } @@ -191,7 +171,6 @@ fold_minus(void) /* expect+1: warning: integer overflow detected, op '-' [141] */ take_int(-2147483647 - 2); - /* expect+1: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */ take_int(0 - 2147483648); /* expect+1: warning: integer overflow detected, op '-' [141] */ take_uint(0 - 2147483648U); Index: src/tests/usr.bin/xlint/lint1/expr_fold.exp diff -u src/tests/usr.bin/xlint/lint1/expr_fold.exp:1.5 src/tests/usr.bin/xlint/lint1/expr_fold.exp:1.6 --- src/tests/usr.bin/xlint/lint1/expr_fold.exp:1.5 Mon Aug 23 06:50:01 2021 +++ src/tests/usr.bin/xlint/lint1/expr_fold.exp Fri Apr 15 21:50:07 2022 @@ -1,53 +1,34 @@ -expr_fold.c(35): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] +expr_fold.c(33): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] expr_fold.c(35): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] -expr_fold.c(39): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(39): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] -expr_fold.c(44): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] -expr_fold.c(46): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] -expr_fold.c(64): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(68): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(72): warning: integer overflow detected, op '+' [141] -expr_fold.c(72): warning: integer overflow detected, op '-' [141] -expr_fold.c(74): warning: integer overflow detected, op '-' [141] -expr_fold.c(77): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(77): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] -expr_fold.c(82): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259] -expr_fold.c(82): warning: conversion of negative constant to unsigned type, arg #1 [296] -expr_fold.c(85): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] -expr_fold.c(85): warning: conversion of negative constant to unsigned type, arg #1 [296] -expr_fold.c(88): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] -expr_fold.c(88): warning: conversion of negative constant to unsigned type, arg #1 [296] -expr_fold.c(98): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(98): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] -expr_fold.c(101): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(101): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] -expr_fold.c(105): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259] -expr_fold.c(105): warning: conversion of negative constant to unsigned type, arg #1 [296] -expr_fold.c(108): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259] -expr_fold.c(108): warning: conversion of negative constant to unsigned type, arg #1 [296] -expr_fold.c(111): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] -expr_fold.c(111): warning: conversion of negative constant to unsigned type, arg #1 [296] -expr_fold.c(114): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259] -expr_fold.c(114): warning: conversion of negative constant to unsigned type, arg #1 [296] -expr_fold.c(122): warning: integer overflow detected, op '*' [141] -expr_fold.c(124): warning: integer overflow detected, op '*' [141] -expr_fold.c(129): warning: integer overflow detected, op '*' [141] -expr_fold.c(138): error: division by 0 [139] -expr_fold.c(138): warning: integer overflow detected, op '/' [141] -expr_fold.c(142): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(142): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] -expr_fold.c(149): error: modulus by 0 [140] -expr_fold.c(151): error: modulus by 0 [140] -expr_fold.c(153): error: modulus by 0 [140] -expr_fold.c(155): error: modulus by 0 [140] -expr_fold.c(158): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(165): warning: integer overflow detected, op '+' [141] -expr_fold.c(171): warning: integer overflow detected, op '+' [141] -expr_fold.c(188): warning: integer overflow detected, op '-' [141] -expr_fold.c(192): warning: integer overflow detected, op '-' [141] -expr_fold.c(195): warning: argument #1 is converted from 'long' to 'int' due to prototype [259] -expr_fold.c(197): warning: integer overflow detected, op '-' [141] -expr_fold.c(204): warning: integer overflow detected, op '<<' [141] -expr_fold.c(207): warning: integer overflow detected, op '<<' [141] -expr_fold.c(211): warning: shift amount 104 is greater than bit-size 32 of 'unsigned int' [122] -expr_fold.c(223): warning: shift amount 104 is greater than bit-size 32 of 'int' [122] +expr_fold.c(64): warning: integer overflow detected, op '+' [141] +expr_fold.c(64): warning: integer overflow detected, op '-' [141] +expr_fold.c(66): warning: integer overflow detected, op '-' [141] +expr_fold.c(68): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] +expr_fold.c(72): warning: conversion of negative constant to unsigned type, arg #1 [296] +expr_fold.c(74): warning: conversion of negative constant to unsigned type, arg #1 [296] +expr_fold.c(76): warning: conversion of negative constant to unsigned type, arg #1 [296] +expr_fold.c(85): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] +expr_fold.c(87): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] +expr_fold.c(90): warning: conversion of negative constant to unsigned type, arg #1 [296] +expr_fold.c(92): warning: conversion of negative constant to unsigned type, arg #1 [296] +expr_fold.c(94): warning: conversion of negative constant to unsigned type, arg #1 [296] +expr_fold.c(96): warning: conversion of negative constant to unsigned type, arg #1 [296] +expr_fold.c(104): warning: integer overflow detected, op '*' [141] +expr_fold.c(106): warning: integer overflow detected, op '*' [141] +expr_fold.c(111): warning: integer overflow detected, op '*' [141] +expr_fold.c(120): error: division by 0 [139] +expr_fold.c(120): warning: integer overflow detected, op '/' [141] +expr_fold.c(123): warning: conversion of 'long' to 'int' is out of range, arg #1 [295] +expr_fold.c(130): error: modulus by 0 [140] +expr_fold.c(132): error: modulus by 0 [140] +expr_fold.c(134): error: modulus by 0 [140] +expr_fold.c(136): error: modulus by 0 [140] +expr_fold.c(145): warning: integer overflow detected, op '+' [141] +expr_fold.c(151): warning: integer overflow detected, op '+' [141] +expr_fold.c(168): warning: integer overflow detected, op '-' [141] +expr_fold.c(172): warning: integer overflow detected, op '-' [141] +expr_fold.c(176): warning: integer overflow detected, op '-' [141] +expr_fold.c(183): warning: integer overflow detected, op '<<' [141] +expr_fold.c(186): warning: integer overflow detected, op '<<' [141] +expr_fold.c(190): warning: shift amount 104 is greater than bit-size 32 of 'unsigned int' [122] +expr_fold.c(202): warning: shift amount 104 is greater than bit-size 32 of 'int' [122] Index: src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c diff -u src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.5 src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c:1.5 Thu Sep 2 17:55:27 2021 +++ src/tests/usr.bin/xlint/lint1/msg_259_ilp32.c Fri Apr 15 21:50:07 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_259_ilp32.c,v 1.5 2021/09/02 17:55:27 rillig Exp $ */ +/* $NetBSD: msg_259_ilp32.c,v 1.6 2022/04/15 21:50:07 rillig Exp $ */ # 3 "msg_259_ilp32.c" // Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] @@ -11,7 +11,7 @@ */ /* lint1-only-if: ilp32 */ -/* lint1-extra-flags: -h */ +/* lint1-flags: -h -w */ void plain_char(char); void signed_int(int); Index: src/tests/usr.bin/xlint/lint1/msg_259.c diff -u src/tests/usr.bin/xlint/lint1/msg_259.c:1.19 src/tests/usr.bin/xlint/lint1/msg_259.c:1.20 --- src/tests/usr.bin/xlint/lint1/msg_259.c:1.19 Thu Sep 2 17:55:27 2021 +++ src/tests/usr.bin/xlint/lint1/msg_259.c Fri Apr 15 21:50:07 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_259.c,v 1.19 2021/09/02 17:55:27 rillig Exp $ */ +/* $NetBSD: msg_259.c,v 1.20 2022/04/15 21:50:07 rillig Exp $ */ # 3 "msg_259.c" // Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] @@ -20,7 +20,7 @@ */ /* lint1-only-if: lp64 */ -/* lint1-extra-flags: -h */ +/* lint1-flags: -g -h -w */ void plain_char(char); void signed_char(signed char); Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.426 src/usr.bin/xlint/lint1/tree.c:1.427 --- src/usr.bin/xlint/lint1/tree.c:1.426 Fri Apr 15 17:08:21 2022 +++ src/usr.bin/xlint/lint1/tree.c Fri Apr 15 21:50:07 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.426 2022/04/15 17:08:21 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.427 2022/04/15 21:50:07 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: tree.c,v 1.426 2022/04/15 17:08:21 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.427 2022/04/15 21:50:07 rillig Exp $"); #endif #include <float.h> @@ -2077,8 +2077,9 @@ convert(op_t op, int arg, type_t *tp, tn nt = tp->t_tspec; ot = tn->tn_type->t_tspec; - if (!tflag && !sflag && op == FARG) + if (!tflag && !sflag && !Sflag && op == FARG) check_prototype_conversion(arg, nt, ot, tp, tn); + if (is_integer(nt) && is_integer(ot)) { check_integer_conversion(op, arg, nt, ot, tp, tn); } else if (nt == PTR && is_null_pointer(tn)) {