Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang-tidy fails with version 15+ #365

Open
ckreibich opened this issue Jun 14, 2023 · 2 comments
Open

clang-tidy fails with version 15+ #365

ckreibich opened this issue Jun 14, 2023 · 2 comments
Assignees

Comments

@ckreibich
Copy link
Member

I noticed this during a routine CI config update (#364). Details on Cirrus. The update currently sidesteps this by sticking with a distro that still uses llvm 14, but sooner or later this will need resolving. The exact set of errors depends on the clang-tidy version, but the good news is that it's just a handful. In the above run:

/broker/caf/libcaf_core/caf/config_value.hpp:550:7: error: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn,-warnings-as-errors]
      return std::move(*val);
      ^

/broker/caf/libcaf_core/caf/config_value.hpp:106:5: error: 1st function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage,-warnings-as-errors]
    set(std::forward<T>(x));
    ^

As these straddle Broker and CAF I'm not sure how to proceed — seems Broker's clang-tidy run should not complain about things it finds in CAF, since CAF has its own clang-tidy setup. I can't tell if Broker is doing anything wrong in its use of those CAF APIs.

One idea I had was to treat the CAF headers as system headers, so there's a way to mute their findings, but I couldn't get that to work.

@Neverlord
Copy link
Member

Weird, we set HeaderFilterRegex: 'broker/.*.hh' in the clang-tidy file to ignore everything from other sources. Let me look into it.

@Neverlord
Copy link
Member

I can see that diagnostic locally with 16.0.5 as well. I have no idea why it thinks that could be a garbage value. That line just unpacks an expected value. Looks like a false positive to me. I'll maybe try tweaking it a bit and otherwise add a NOLINT there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants