<feed xmlns='http://www.w3.org/2005/Atom'>
<title>netbsd/tests/usr.bin/xlint/lint1/gcc_attribute_var.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: 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: clean up</title>
<updated>2023-02-05T10:57:48+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2023-02-05T10:57:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=acc3192b43364daa6cfd7cd08053c2963fd6528c'/>
<id>acc3192b43364daa6cfd7cd08053c2963fd6528c</id>
<content type='text'>
The .exp files are no longer kept under version control, so there's no
reason anymore to forcefully trigger a warning or an error.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The .exp files are no longer kept under version control, so there's no
reason anymore to forcefully trigger a warning or an error.</pre>
</div>
</content>
</entry>
<entry>
<title>lint: remove explicit list of known GCC attributes</title>
<updated>2022-08-25T19:03:47+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2022-08-25T19:03:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=d8fd69710d3c313e9a96d43be4672a5238120115'/>
<id>d8fd69710d3c313e9a96d43be4672a5238120115</id>
<content type='text'>
Most GCC attributes consist of a single identifier.  Up to now, it was
necessary to list each of these identifiers in the grammar, even those
that only apply to a single target architecture.

Instead, parse the general form of attributes, matching the few
attributes that lint handles by name instead.  While here, rename the
grammar rules to use the GCC terms.

To avoid conflicts between the global function 'printf' and the GCC
attribute of the same name, do not add GCC attributes to the symbol
table, and don't make these symbols 'extern' either.

ok christos@.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Most GCC attributes consist of a single identifier.  Up to now, it was
necessary to list each of these identifiers in the grammar, even those
that only apply to a single target architecture.

Instead, parse the general form of attributes, matching the few
attributes that lint handles by name instead.  While here, rename the
grammar rules to use the GCC terms.

To avoid conflicts between the global function 'printf' and the GCC
attribute of the same name, do not add GCC attributes to the symbol
table, and don't make these symbols 'extern' either.

ok christos@.</pre>
</div>
</content>
</entry>
<entry>
<title>lint: allow GCC __attribute__ after array brackets</title>
<updated>2021-08-11T05:19:32+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-08-11T05:19:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=863a730d425f4a0d7395b8c6f49037764c6ad26b'/>
<id>863a730d425f4a0d7395b8c6f49037764c6ad26b</id>
<content type='text'>
GCC accepts this, so should lint.  Seen in pam_lastlog.c:115.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
GCC accepts this, so should lint.  Seen in pam_lastlog.c:115.</pre>
</div>
</content>
</entry>
<entry>
<title>tests/lint: demonstrate wrong 'syntax error' for unused argument</title>
<updated>2021-08-11T05:08:35+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-08-11T05:08:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=70326e23196a5305cb52c52fae8498041d8755f2'/>
<id>70326e23196a5305cb52c52fae8498041d8755f2</id>
<content type='text'>
Seen in pam_chroot.c:60.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Seen in pam_chroot.c:60.</pre>
</div>
</content>
</entry>
<entry>
<title>lint: fix bug when parsing unused variable (since 2021-07-10)</title>
<updated>2021-07-11T15:07:39+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-07-11T15:07:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=cf34e2a2fc2f253212991a9ad802bf4f1321c802'/>
<id>cf34e2a2fc2f253212991a9ad802bf4f1321c802</id>
<content type='text'>
Partially revert to cgram.y 1.248 from 2021-06-29.

This fixes the parse error for variables whose declaration starts with
__attribute__((unused)).  In the many refactorings of the last days this
bug has slipped in, and since there were several refactorings in that
area, there may be have been further bugs that are not caught by the
current test suite.  Revert for now and maybe apply them later again
when there are more tests.

Things kept from the current version are:

The names of most of the rules, as they correspond more closely to C99
and do not affect the behavior in any way.

In type_direct_decl, the replacement of type_attribute_list with
type_attribute since that nonterminal is already part of a repetition
(saves 4 conflicts).

In block_item, the order of the rules corresponds to C99.  This has no
influence on the generated parser, except for the rule numbers, which
are informative.

The merge of the duplicate code for struct_tag, enum_tag and
enum_constant, as they all contained exactly the same code.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Partially revert to cgram.y 1.248 from 2021-06-29.

This fixes the parse error for variables whose declaration starts with
__attribute__((unused)).  In the many refactorings of the last days this
bug has slipped in, and since there were several refactorings in that
area, there may be have been further bugs that are not caught by the
current test suite.  Revert for now and maybe apply them later again
when there are more tests.

Things kept from the current version are:

The names of most of the rules, as they correspond more closely to C99
and do not affect the behavior in any way.

In type_direct_decl, the replacement of type_attribute_list with
type_attribute since that nonterminal is already part of a repetition
(saves 4 conflicts).

In block_item, the order of the rules corresponds to C99.  This has no
influence on the generated parser, except for the rule numbers, which
are informative.

The merge of the duplicate code for struct_tag, enum_tag and
enum_constant, as they all contained exactly the same code.</pre>
</div>
</content>
</entry>
<entry>
<title>tests/lint: analyze yesterday's bug for parsing declarations</title>
<updated>2021-07-11T13:32:06+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-07-11T13:32:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=5f594958e4ecfaa4b4dfc32e8add19a80ac720bb'/>
<id>5f594958e4ecfaa4b4dfc32e8add19a80ac720bb</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 tests for GCC __attribute__</title>
<updated>2021-07-06T17:33:07+00:00</updated>
<author>
<name>rillig</name>
<email>rillig@NetBSD.org</email>
</author>
<published>2021-07-06T17:33:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.infra.scholz.ruhr/netbsd/commit/?id=a70e7bc559c76f2e5d4434516cc9e2029ccc1619'/>
<id>a70e7bc559c76f2e5d4434516cc9e2029ccc1619</id>
<content type='text'>
Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before fixing the wrong handling of __attribute__ that is demonstrated
at the end of gcc_attribute.c, ensure that the attribute handling works
in the most basic cases.

Lint currently accepts __attribute__ in more places than it should.
This leads to some ambiguities in the grammar.</pre>
</div>
</content>
</entry>
</feed>
