<feed xmlns='http://www.w3.org/2005/Atom'>
<title>passt/.clang-tidy, branch 2026_12_04.a39d958</title>
<subtitle>Plug A Simple Socket Transport</subtitle>
<link rel='alternate' type='text/html' href='https://passt.top/passt/'/>
<entry>
<title>clang-tidy: Disable checks new in clang-tidy 23</title>
<updated>2026-11-22T21:06:25+00:00</updated>
<author>
<name>Jon Maloy</name>
<email>jmaloy@redhat.com</email>
</author>
<published>2026-11-20T01:32:47+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=16bf5c49fa8706613318ac17ea7b5682a6e2cf41'/>
<id>16bf5c49fa8706613318ac17ea7b5682a6e2cf41</id>
<content type='text'>
clang-tidy 23 introduces three new checks, which make
'make clang-tidy' fail on code that's otherwise fine:

- readability-trailing-comma wants a trailing comma in every
  multi-line initialiser list, and none in single-line ones. That's
  not part of our coding style, and it reports about 30 sites
  (dhcpv6.c, ndp.c, netlink.c, pcap.c, tap.c, ...)

- readability-redundant-nested-if wants nested if statements merged
  into a single condition, also where the inner condition has side
  effects, as in bind() or setsockopt() calls, or a dedicated comment
  (util.c, tcp.c, ...). Merging those would hurt readability, much
  like the braces-around-statements checks we already disable

- bugprone-assignment-in-selection-statement, which cert-exp45-c is
  now an alias of, reports assignments in conditions (conf.c, flow.c,
  udp.c), like bugprone-assignment-in-if-condition, which we already
  disable for the same reasons

Disable these checks.

Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clang-tidy 23 introduces three new checks, which make
'make clang-tidy' fail on code that's otherwise fine:

- readability-trailing-comma wants a trailing comma in every
  multi-line initialiser list, and none in single-line ones. That's
  not part of our coding style, and it reports about 30 sites
  (dhcpv6.c, ndp.c, netlink.c, pcap.c, tap.c, ...)

- readability-redundant-nested-if wants nested if statements merged
  into a single condition, also where the inner condition has side
  effects, as in bind() or setsockopt() calls, or a dedicated comment
  (util.c, tcp.c, ...). Merging those would hurt readability, much
  like the braces-around-statements checks we already disable

- bugprone-assignment-in-selection-statement, which cert-exp45-c is
  now an alias of, reports assignments in conditions (conf.c, flow.c,
  udp.c), like bugprone-assignment-in-if-condition, which we already
  disable for the same reasons

Disable these checks.

Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clang-tidy: Also disable bugprone-signed-bitwise</title>
<updated>2026-11-22T21:06:10+00:00</updated>
<author>
<name>Jon Maloy</name>
<email>jmaloy@redhat.com</email>
</author>
<published>2026-11-20T01:32:46+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=4f656c0f08e0ab36df88a52c6b36f4ac3dc419d2'/>
<id>4f656c0f08e0ab36df88a52c6b36f4ac3dc419d2</id>
<content type='text'>
The hicpp-signed-bitwise check is disabled in .clang-tidy, as we need
bitwise operations on signed values for syscalls, epoll_wait() flags,
etc.

clang-tidy 23 removed the hicpp module, moving its checks to other
modules, and hicpp-signed-bitwise became bugprone-signed-bitwise. The
existing exclusion therefore no longer applies, and as we enable all
checks and treat warnings as errors, 'make clang-tidy' fails with
clang-tidy 23.1.5, e.g.:

  arp.c:139:37: error: use of a signed integer operand with a binary
  bitwise operator [bugprone-signed-bitwise,-warnings-as-errors]
    139 |         a = fwd_get_addr(c, AF_INET, true, CONF_ADDR_ANY);

where CONF_ADDR_ANY is built from BIT(n), that is, (1UL &lt;&lt; (n)), and
the shift count is a signed int.

Disable the check under its new name as well, keeping the old one for
older clang-tidy versions.

Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The hicpp-signed-bitwise check is disabled in .clang-tidy, as we need
bitwise operations on signed values for syscalls, epoll_wait() flags,
etc.

clang-tidy 23 removed the hicpp module, moving its checks to other
modules, and hicpp-signed-bitwise became bugprone-signed-bitwise. The
existing exclusion therefore no longer applies, and as we enable all
checks and treat warnings as errors, 'make clang-tidy' fails with
clang-tidy 23.1.5, e.g.:

  arp.c:139:37: error: use of a signed integer operand with a binary
  bitwise operator [bugprone-signed-bitwise,-warnings-as-errors]
    139 |         a = fwd_get_addr(c, AF_INET, true, CONF_ADDR_ANY);

where CONF_ADDR_ANY is built from BIT(n), that is, (1UL &lt;&lt; (n)), and
the shift count is a signed int.

Disable the check under its new name as well, keeping the old one for
older clang-tidy versions.

Signed-off-by: Jon Maloy &lt;jmaloy@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clang-tidy: Suppress some new unhelpful new warnings</title>
<updated>2026-05-11T22:04:11+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-05-11T10:03:22+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=4de7c3826d810e2e3f7f404dc8037ab445d6f2f0'/>
<id>4de7c3826d810e2e3f7f404dc8037ab445d6f2f0</id>
<content type='text'>
clang-tidy 22.1.4 (or thereabouts) introduced some new warning categories
that while theoretically useful, trip in too many silly occasions to be
useful.  Suppress them.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
clang-tidy 22.1.4 (or thereabouts) introduced some new warning categories
that while theoretically useful, trip in too many silly occasions to be
useful.  Suppress them.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Reviewed-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clang-tidy: Don't insist on #ifdef over #if defined()</title>
<updated>2026-03-04T16:53:33+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2026-03-02T04:31:35+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=685864dea8c35a6abf3ab61de786167e73b18816'/>
<id>685864dea8c35a6abf3ab61de786167e73b18816</id>
<content type='text'>
Commit 036fb8770 ("checksum: add VSX fast path for POWER8/POWER9") changed
an #ifdef to #if defined, in order to match a newly introduced #if which
needs to check two different symbols.  This causes clang-tidy to complain
that the directive could be written more concisely.

In this case consistency with the other #if branch seems more important,
and in general insisting on #ifdef over #if seems unhelpfully pedantic.
Suppress that warning globally.

Reported-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Fixes: 036fb8770cc2 ("checksum: add VSX fast path for POWER8/POWER9")
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 036fb8770 ("checksum: add VSX fast path for POWER8/POWER9") changed
an #ifdef to #if defined, in order to match a newly introduced #if which
needs to check two different symbols.  This causes clang-tidy to complain
that the directive could be written more concisely.

In this case consistency with the other #if branch seems more important,
and in general insisting on #ifdef over #if seems unhelpfully pedantic.
Suppress that warning globally.

Reported-by: Laurent Vivier &lt;lvivier@redhat.com&gt;
Fixes: 036fb8770cc2 ("checksum: add VSX fast path for POWER8/POWER9")
Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>clang: Move clang-tidy configuration from Makefile to .clang-tidy</title>
<updated>2024-11-07T11:46:19+00:00</updated>
<author>
<name>David Gibson</name>
<email>david@gibson.dropbear.id.au</email>
</author>
<published>2024-11-05T23:25:19+00:00</published>
<link rel='alternate' type='text/html' href='https://passt.top/passt/commit/?id=b78e72da0b27e222592ff1f1578c69bad4756c65'/>
<id>b78e72da0b27e222592ff1f1578c69bad4756c65</id>
<content type='text'>
Currently we configure clang-tidy with a very long command line spelled out
in the Makefile (mostly a big list of lints to disable).  Move it from here
into a .clang-tidy configuration file, so that the config is accessible if
clang-tidy is invoked in other ways (e.g. via clangd) as well.  As a bonus
this also means that we can move the bulky comments about why we're
suppressing various tests inline with the relevant config lines.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently we configure clang-tidy with a very long command line spelled out
in the Makefile (mostly a big list of lints to disable).  Move it from here
into a .clang-tidy configuration file, so that the config is accessible if
clang-tidy is invoked in other ways (e.g. via clangd) as well.  As a bonus
this also means that we can move the bulky comments about why we're
suppressing various tests inline with the relevant config lines.

Signed-off-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Stefano Brivio &lt;sbrivio@redhat.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
