Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[clang-tidy] fix warning about decaying array to pointer #1926

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

Merged
merged 12 commits into from
Feb 11, 2025
Merged

Conversation

dmah42
Copy link
Member

@dmah42 dmah42 commented Feb 11, 2025

Part of #1925

@dmah42 dmah42 marked this pull request as ready for review February 11, 2025 17:59
Comment on lines +20 to +22
MSVC_COPTS = [
"/std:c++17",
]
Copy link
Contributor

@nicholasjng nicholasjng Feb 11, 2025

Choose a reason for hiding this comment

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

fyi: If C++17 is the default now, it might make sense to add the standard into a .bazelrc file, since I'm also injecting the C++17 standard option by hand in the bindings build.

EDIT: This is how I'm doing it in a nanobind project I'm maintaining:

# .bazelrc

# Enable automatic configs based on platform
common --enable_platform_specific_config

# Set minimum supported C++ version
build:macos --host_cxxopt=-std=c++17 --cxxopt=-std=c++17
build:linux --host_cxxopt=-std=c++17 --cxxopt=-std=c++17
build:windows --host_cxxopt=/std:c++17 --cxxopt=/std:c++17

# Set minimum supported MacOS version to 10.14 for C++17.
build:macos --macos_minimum_os=10.14

Copy link
Member Author

Choose a reason for hiding this comment

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

why wouldn't it being in the bazel BUILD files be sufficient?

Copy link
Contributor

Choose a reason for hiding this comment

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

It is, I just thought that having it in the config would save some lines, and make it easier to change when the standard is updated. totally fine to keep as is, just wanted to mention it.

LebedevRI
LebedevRI previously approved these changes Feb 11, 2025
Copy link
Collaborator

@LebedevRI LebedevRI left a comment

Choose a reason for hiding this comment

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

Seems fine, but is that really all of these?
It would be good to actually enable the check that issued the warning as part of the PR.

@dmah42
Copy link
Member Author

dmah42 commented Feb 11, 2025

Seems fine, but is that really all of these? It would be good to actually enable the check that issued the warning as part of the PR.

it's not all. i'm trying to keep the PRs somewhat small.

the check is enabled, and is issuing a warning (not an error). i want to get clang-tidy clean so then i'll make it a required bot.

@LebedevRI
Copy link
Collaborator

Seems fine, but is that really all of these? It would be good to actually enable the check that issued the warning as part of the PR.

it's not all. i'm trying to keep the PRs somewhat small.

Sure, but i'm talking about the warnings from this specific check.

the check is enabled, and is issuing a warning (not an error). i want to get clang-tidy clean so then i'll make it a required bot.

@dmah42
Copy link
Member Author

dmah42 commented Feb 11, 2025

Seems fine, but is that really all of these? It would be good to actually enable the check that issued the warning as part of the PR.

it's not all. i'm trying to keep the PRs somewhat small.

Sure, but i'm talking about the warnings from this specific check.

yes, i understood that. it's not all of the fixes for this one check. that would make the PR quite a bit bigger.

the check is enabled, and is issuing a warning (not an error). i want to get clang-tidy clean so then i'll make it a required bot.

* use unique_ptr for benchmark registration
@dmah42 dmah42 merged commit c68e308 into main Feb 11, 2025
96 of 101 checks passed
@dmah42 dmah42 deleted the fix_array_decay branch February 11, 2025 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants