-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[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
Conversation
MSVC_COPTS = [ | ||
"/std:c++17", | ||
] |
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.
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
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.
why wouldn't it being in the bazel BUILD files be sufficient?
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.
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.
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.
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. |
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.
|
* use unique_ptr for benchmark registration
Part of #1925