<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/tests/usr.bin/xlint/lint1/msg_240.c, branch lockdoc-10.99.5</title>
<subtitle>NetBSD fork for lockdoc analysis</subtitle>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/'/>
<entry>
<title>lint: only skip 'unused' warnings after errors, not other warnings</title>
<updated>2023-07-07T06:03:31+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2023-07-07T06:03:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=f260bdb92f361d3b4e3ab9d23e5f0eb4faafd698'/>
<id>f260bdb92f361d3b4e3ab9d23e5f0eb4faafd698</id>
<content type='text'>
Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that.  This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, in -w mode, any warning suppressed further 'unused'
warnings, even though there was no need to do that.  This can be seen in
the test gcc_attribute_var.c, where only the last unused variable from a
function was marked as unused, the others slipped through.

Fixed by counting the errors and the warnings separately and only
combining them if actually desired.</pre>
</div>
</content>
</entry>
<entry>
<title>lint: add quotes around operator in message 138, remove message 240</title>
<updated>2022-07-01T20:53:13+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2022-07-01T20:53:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=b19128d54d847af92020e30c33f4a4749b7d4b69'/>
<id>b19128d54d847af92020e30c33f4a4749b7d4b69</id>
<content type='text'>
Message 138 doesn't occur in practice, it was the last one that was
missing the quotes around the placeholder.

Message 240 was also missing the quotes, but it was not reachable. There
was also no apparent benefit in warning about 'assignment of different
structures' when the message about 'assignment type mismatch' serves the
same purpose.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Message 138 doesn't occur in practice, it was the last one that was
missing the quotes around the placeholder.

Message 240 was also missing the quotes, but it was not reachable. There
was also no apparent benefit in warning about 'assignment of different
structures' when the message about 'assignment type mismatch' serves the
same purpose.</pre>
</div>
</content>
</entry>
<entry>
<title>tests/lint: add more details to messages in msg_200 until msg_299</title>
<updated>2022-06-16T21:24:41+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2022-06-16T21:24:41+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=124b879711d24688ae24bfe86bafd30c72a02c6c'/>
<id>124b879711d24688ae24bfe86bafd30c72a02c6c</id>
<content type='text'>
Add some tests that were previously empty.  Some other tests are still
empty.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add some tests that were previously empty.  Some other tests are still
empty.</pre>
</div>
</content>
</entry>
<entry>
<title>lint: force each test to declare the expected diagnostics</title>
<updated>2021-02-21T09:07:58+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-02-21T09:07:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=a9ec1e96dc16359848a87a43db56986d0b521dea'/>
<id>a9ec1e96dc16359848a87a43db56986d0b521dea</id>
<content type='text'>
By listing the expected diagnostics directly at the code that triggers
the diagnostics, it is easier to cross-check whether the diagnostics
make sense.

No functional change to lint itself.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
By listing the expected diagnostics directly at the code that triggers
the diagnostics, it is easier to cross-check whether the diagnostics
make sense.

No functional change to lint itself.</pre>
</div>
</content>
</entry>
<entry>
<title>lint: add a test for each message produced by lint1</title>
<updated>2021-01-02T10:22:42+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-01-02T10:22:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=f42ea02bea1427be8a41fd952470bdf4f834e26e'/>
<id>f42ea02bea1427be8a41fd952470bdf4f834e26e</id>
<content type='text'>
Having a test for each message ensures that upcoming refactorings don't
break the basic functionality.  Adding the tests will also discover
previously unknown bugs in lint.

The tests ensure that every lint message can actually be triggered, and
they demonstrate how to do so.  Having a separate file for each test
leaves enough space for documenting historical anecdotes, rationale or
edge cases, keeping them away from the source code.

The interesting details of this commit are in Makefile and
t_integration.sh.  All other files are just auto-generated.

When running the tests as part of ATF, they are packed together as a
single test case.  Conceptually, it would have been better to have each
test as a separate test case, but ATF quickly becomes very slow as soon
as a test program defines too many test cases, and 50 is already too
many.  The time complexity is O(n^2), not O(n) as one would expect.
It's the same problem as in tests/usr.bin/make, which has over 300 test
cases as well.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Having a test for each message ensures that upcoming refactorings don't
break the basic functionality.  Adding the tests will also discover
previously unknown bugs in lint.

The tests ensure that every lint message can actually be triggered, and
they demonstrate how to do so.  Having a separate file for each test
leaves enough space for documenting historical anecdotes, rationale or
edge cases, keeping them away from the source code.

The interesting details of this commit are in Makefile and
t_integration.sh.  All other files are just auto-generated.

When running the tests as part of ATF, they are packed together as a
single test case.  Conceptually, it would have been better to have each
test as a separate test case, but ATF quickly becomes very slow as soon
as a test program defines too many test cases, and 50 is already too
many.  The time complexity is O(n^2), not O(n) as one would expect.
It's the same problem as in tests/usr.bin/make, which has over 300 test
cases as well.</pre>
</div>
</content>
</entry>
</feed>
