-
Notifications
You must be signed in to change notification settings - Fork 16
Introduce clang-tidy #920
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
base: master
Are you sure you want to change the base?
Introduce clang-tidy #920
Changes from all commits
4fc4b5a
bf6ea2f
cab6e02
f67eb09
10f83c3
3f9dfc6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| # SPDX-FileCopyrightText: 2025 Institute for Automation of Complex Power Systems, RWTH Aachen University | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| Checks: > | ||
| -*, | ||
| modernize-use-override, | ||
| misc-const-correctness, | ||
| WarningsAsErrors: '*' | ||
| HeaderFilterRegex: villas/.* | ||
| FormatStyle: file |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,3 +2,4 @@ | |
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| use flake | ||
| pre-commit install | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,8 +11,6 @@ | |
|
|
||
| #pragma once | ||
|
|
||
| #include <list> | ||
| #include <memory> | ||
| #include <string> | ||
| #include <vector> | ||
|
|
||
|
|
@@ -99,7 +97,7 @@ class Device { | |
| std::vector<void *> mappings; | ||
|
|
||
| // libpci handle of the device | ||
| const kernel::devices::PciDevice *pci_device; | ||
| [[maybe_unused]] const kernel::devices::PciDevice *pci_device; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really something we want to introduce? It adds clutter to the code. In this instance, we should check whether we actually need this (now or in the future) and rather remove it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This private member variable was set in the constructor, yet never read or used anywhere. I didn't know whether this was some kind of guard variable keeping a PCI connection alive or something like that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suspect it's a leftover from when vfio devices were always PCI devices. If it's really unused now, we can remove it. |
||
|
|
||
| Logger log; | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you motivate why you introduced these new options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GCC and Clang have a different set of warnings enabled with
-Wall. This silences two warnings that would, together with-Werrorbreak a Clang Build.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't fixing them be more desireable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I introduced two new flags here.
-Wno-vla-cxx-extension: Clang would issue a warning for each variable length array on the stack. This affects most node types.-Wno-unused-command-line-argument: CMake seems to introduce-Wl,--compress-debug-sectionscommand line arguments which Clang doesn't understand and then warns on.