You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of protobuf and what language are you using?
Version: 22.x but I think the problem is also in main
Language: C++
What operating system (Linux, Windows, ...) and version?
Windows
What runtime / compiler are you using (e.g., python version or gcc version)
MSVC 2019 or MSVC 2022
What did you do?
Compiled some generated protos with /WX /W4, this is analogous to -Wall -Werror with GCC or Clang.
What did you expect to see
A successful compilation.
What did you see instead?
A compilation warning. As I have enabled "warnings as errors" it breaks the build.
# Configuration: f149506ea002c5503763e19bb7f79693d083f873032cd55c19002b510a750b73
# Execution platform: @local_config_platform//:host
bazel-out/x64_windows-opt/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/arena_align\google/protobuf/arena_align.h(102): error C2220: the following warning is treated as an error
bazel-out/x64_windows-opt/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/arena_align\google/protobuf/arena_align.h(102): warning C4146: unary minus operator applied to unsigned type, result still unsigned
bazel-out/x64_windows-opt/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/arena_align\google/protobuf/arena_align.h(145): warning C4146: unary minus operator applied to unsigned type, result still unsigned
bazel-out/x64_windows-opt/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/arena_align\google/protobuf/arena_align.h(159): warning C4146: unary minus operator applied to unsigned type, result still unsigned
bazel-out/x64_windows-opt/bin/external/com_google_protobuf/src/google/protobuf/_virtual_includes/protobuf_lite\google/protobuf/arena.h(300): note: see reference to function template instantiation 'T *google::protobuf::internal::ArenaAlign::Ceil<void>(T *) const' being compiled
with
[
T=void
]
INFO: From Action external/com_google_googleapis/google/cloud/certificatemanager/v1/certificate_issuance_config.grpc.pb.h:
Anything else we should know about your project / environment
I usually try to workaround these problems by disabling the warning when including external headers, but I have not been very successful this time. If at all possible consider patching the headers.
What version of protobuf and what language are you using?
Version: 22.x but I think the problem is also in main
Language: C++
What operating system (Linux, Windows, ...) and version?
Windows
What runtime / compiler are you using (e.g., python version or gcc version)
MSVC 2019 or MSVC 2022
What did you do?
Compiled some generated protos with
/WX /W4
, this is analogous to-Wall -Werror
with GCC or Clang.What did you expect to see
A successful compilation.
What did you see instead?
A compilation warning. As I have enabled "warnings as errors" it breaks the build.
Anything else we should know about your project / environment
I usually try to workaround these problems by disabling the warning when including external headers, but I have not been very successful this time. If at all possible consider patching the headers.
You can repro the problem using godbolt:
https://godbolt.org/z/ces8Y7EPb
Changing the alignment to an
int
works:https://godbolt.org/z/e837Kz6fc
Adding some casts also works:
https://godbolt.org/z/9M44v7bc6
Note that the same problem appears in 3 places in the code:
https://github.com/protocolbuffers/protobuf/blob/0ae328929ee2b6378d8cb3bb2c26700922098910/src/google/protobuf/arena_align.h#LL101C1-L103C4
protobuf/src/google/protobuf/arena_align.h
Line 145 in 0ae3289
and
protobuf/src/google/protobuf/arena_align.h
Line 159 in 0ae3289
That is the "fixes" are more like "proof-of-concepts" or "sketches".
The text was updated successfully, but these errors were encountered: