<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/tests/usr.bin/xlint/lint1/msg_259.c, branch trunk</title>
<subtitle>NetBSD fork for lockdoc analysis</subtitle>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/'/>
<entry>
<title>lint: remove redundant '#' after 'argument' in diagnostics</title>
<updated>2023-07-09T10:42:07+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2023-07-09T10:42:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=61a832267cc5bff1a90f086bd56309a3a0671255'/>
<id>61a832267cc5bff1a90f086bd56309a3a0671255</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>lint: warn about extern declarations outside headers</title>
<updated>2023-03-28T14:44:34+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2023-03-28T14:44:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=ea64962370dcb8ab0cef70a139b7d17a37ec97cd'/>
<id>ea64962370dcb8ab0cef70a139b7d17a37ec97cd</id>
<content type='text'>
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html</pre>
</div>
</content>
</entry>
<entry>
<title>tests/lint: make 'expect+-' comments stricter</title>
<updated>2022-06-17T18:54:53+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2022-06-17T18:54:53+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=53ed6e86bd6a3ed261c76a96cddd65065362a5c7'/>
<id>53ed6e86bd6a3ed261c76a96cddd65065362a5c7</id>
<content type='text'>
Previously, the expectations from these comments were already satisfied
if the expectation occurred somewhere in the actual message from lint.
This meant that the prefix 'error:' or 'warning:' could be omitted from
the 'expect' comment.  These omissions were hard to see in a manual
review.  Now any omissions must be visually marked with '...'.

The test msg_342 now reports its messages properly as being in the file
msg_342.c, rather than msg_341.c.  This had been a copy-and-paste
mistake.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the expectations from these comments were already satisfied
if the expectation occurred somewhere in the actual message from lint.
This meant that the prefix 'error:' or 'warning:' could be omitted from
the 'expect' comment.  These omissions were hard to see in a manual
review.  Now any omissions must be visually marked with '...'.

The test msg_342 now reports its messages properly as being in the file
msg_342.c, rather than msg_341.c.  This had been a copy-and-paste
mistake.</pre>
</div>
</content>
</entry>
<entry>
<title>lint: in C99 mode, do not warn about non-prototype conversions</title>
<updated>2022-04-15T21:50:07+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2022-04-15T21:50:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=8aeade7a226228d4a7dfa1718b5a31efd1997b31'/>
<id>8aeade7a226228d4a7dfa1718b5a31efd1997b31</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>lint: align tests for message 259, clarify its purpose</title>
<updated>2021-09-02T17:55:27+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-09-02T17:55:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=bb3f304bd4aff7002d459948b3caac285369e60f'/>
<id>bb3f304bd4aff7002d459948b3caac285369e60f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>lint: fix unintended warning for converting long long to signed char</title>
<updated>2021-09-02T17:29:19+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-09-02T17:29:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=db60fb3265e0e5a6a33b11e284963b08ec5a078a'/>
<id>db60fb3265e0e5a6a33b11e284963b08ec5a078a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/lint: demonstrate unintended prototype warning for signed char</title>
<updated>2021-09-02T17:26:43+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-09-02T17:26:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=f32858d1e74b7c4501d3fa759b013458081f9fa8'/>
<id>f32858d1e74b7c4501d3fa759b013458081f9fa8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>tests/lint: add cross-references to message 297</title>
<updated>2021-08-31T19:26:23+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-08-31T19:26:23+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=6ee7ecbddbc542870c26ce08730020c6f8f57301'/>
<id>6ee7ecbddbc542870c26ce08730020c6f8f57301</id>
<content type='text'>
The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The check for lossy integer conversions is already implemented, it's
just not activated in the default NetBSD build.</pre>
</div>
</content>
</entry>
<entry>
<title>tests/lint: add test for prototype conversions in C90</title>
<updated>2021-08-31T18:59:26+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-08-31T18:59:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=4fbec4f8fbf21436f364cda86b50204ddfbcec11'/>
<id>4fbec4f8fbf21436f364cda86b50204ddfbcec11</id>
<content type='text'>
The purpose of warning 259 is to find function calls that differ in the
ABI.  The warning's original purpose was not to warn about lossy
conversions, that's just a side effect.

Warning 259 had been implemented before C99 was published, which is more
than 20 years ago.  In the meantime, almost all code has migrated to
using function prototypes.  With the default lint flags from NetBSD's
&lt;sys.mk&gt;, it would rather make sense to focus on lossy conversions now.

To prepare for potentially upcoming differences in lint's C90 and C99
modes, clone the test now as far as possible.  The test for C90 mode is
smaller than for C99 mode, since 'long long' was not available back
then.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The purpose of warning 259 is to find function calls that differ in the
ABI.  The warning's original purpose was not to warn about lossy
conversions, that's just a side effect.

Warning 259 had been implemented before C99 was published, which is more
than 20 years ago.  In the meantime, almost all code has migrated to
using function prototypes.  With the default lint flags from NetBSD's
&lt;sys.mk&gt;, it would rather make sense to focus on lossy conversions now.

To prepare for potentially upcoming differences in lint's C90 and C99
modes, clone the test now as far as possible.  The test for C90 mode is
smaller than for C99 mode, since 'long long' was not available back
then.</pre>
</div>
</content>
</entry>
<entry>
<title>tests/lint: add missing test cases for integer conversions</title>
<updated>2021-08-31T18:15:56+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-08-31T18:15:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=d2bdc9cdf19f2e1d5ecbaf4b42e1f3081c8a3127'/>
<id>d2bdc9cdf19f2e1d5ecbaf4b42e1f3081c8a3127</id>
<content type='text'>
While adding the missing test cases, I re-read the comments and
discarded several of them, since converting a signed value to an
unsigned type can be lossy as well, which warrants a warning.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While adding the missing test cases, I re-read the comments and
discarded several of them, since converting a signed value to an
unsigned type can be lossy as well, which warrants a warning.</pre>
</div>
</content>
</entry>
</feed>
