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

Bump clang-tidy to 19 and fix linter errors #306

Merged
merged 12 commits into from
Jan 28, 2025
Merged

Conversation

edubart
Copy link
Collaborator

@edubart edubart commented Jan 20, 2025

No description provided.

@edubart edubart added the refactor Restructuring code, while not changing its original functionality label Jan 20, 2025
@edubart edubart added this to the v0.19.0 milestone Jan 20, 2025
@edubart edubart self-assigned this Jan 20, 2025
@edubart edubart requested a review from diegonehab January 20, 2025 15:28
.clang-tidy Outdated
@@ -44,7 +43,6 @@ Checks: >-
-readability-function-cognitive-complexity,
-readability-identifier-length,
-readability-magic-numbers,
-readability-enum-initial-value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like this. The standard is pretty clear about what the values would be. So no need to enforce use writing +1, +2 etc. Really, I have no idea why somebody thinks this is less error prone.

@@ -55,73 +55,73 @@ enum virtio_p9fs_constants : uint32_t {
/// \brief 9P2000.L opcodes
enum p9_opcode : uint8_t {
P9_TLERROR = 6,
Copy link
Contributor

@diegonehab diegonehab Jan 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This here was just being lazy. :)

@@ -177,15 +177,15 @@ enum class machine_reg : uint64_t {
uarch_last_ = uarch_x31,

// Views of registers
htif_tohost_dev,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you know PMA_SHADOW_STATE_LENGTH+8 doesn't fall inside PMA_SHADOW_UARCH_STATE? See? The compiler will not warn about repeated enums, because we use repeated enums all the time.

@@ -795,7 +795,7 @@ const pma_entry &machine::find_pma_entry(const CONTAINER &pmas, uint64_t paddr,

template <typename T>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to get rid of this entirely. I want to remove machine::find_pma_entry altogether, and have the update_merkle_tree_page or whatever that uses it t o simply use std::find on the m_merkle_pmas array.

Copy link
Contributor

@diegonehab diegonehab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just don't like the enum one.

@edubart edubart force-pushed the refactor/clang-19-linter branch from da65e33 to 711f920 Compare January 28, 2025 13:26
@edubart edubart requested a review from diegonehab January 28, 2025 13:49
@edubart edubart merged commit 711f920 into main Jan 28, 2025
8 checks passed
@edubart edubart deleted the refactor/clang-19-linter branch January 28, 2025 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Restructuring code, while not changing its original functionality
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants