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

#ifdef out clang-specific pragmas to avoid unknown pragma warnings when compiling with non-clang (#18241) #18428

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/google/protobuf/wire_format_lite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,11 @@ static size_t VarintSize(const T* data, const int n) {
if (x > 0x1FFFFF) sum++;
if (x > 0xFFFFFFF) sum++;
}
#ifdef __clang__
// Clang is not smart enough to see that this loop doesn't run many times
// NOLINTNEXTLINE(google3-runtime-pragma-loop-hint): b/315043579
#pragma clang loop vectorize(disable) unroll(disable) interleave(disable)
#endif
for (; i < n; i++) {
uint32_t x = data[i];
if (ZigZag) {
Expand Down Expand Up @@ -713,9 +715,11 @@ static size_t VarintSize64(const T* data, const int n) {
if (x > 0x1FFFFF) sum++;
if (x > 0xFFFFFFF) sum++;
}
#ifdef __clang__
// Clang is not smart enough to see that this loop doesn't run many times
// NOLINTNEXTLINE(google3-runtime-pragma-loop-hint): b/315043579
#pragma clang loop vectorize(disable) unroll(disable) interleave(disable)
#endif
for (; i < n; i++) {
uint64_t x = data[i];
if (ZigZag) {
Expand Down
Loading