diff options
author | Austin Schuh <austin@peloton-tech.com> | 2015-05-19 23:22:20 -0700 |
---|---|---|
committer | Austin Schuh <austin@peloton-tech.com> | 2015-05-19 23:22:20 -0700 |
commit | e826837f7ebc8cb4a4a7aea520551b5b9a0121b1 (patch) | |
tree | 4f746ddaccb9a2fa4ee2b7c57c0dfe63fd5b4be7 /src/google/protobuf/compiler/cpp/cpp_message.cc | |
parent | 4324bf6bf2d217a478356ccc190acb21347b63b3 (diff) |
Marked compiler literal unsigned.
When compiling a protobuf with gcc 3.3.2 for powerpc, I ran into the
following warning message:
INFO: From Compiling my_proto.pb.cc powerpc-603e-linux-gcc:
bazel-out/local_linux-dbg/genfiles/my_proto.pb.cc: In member
function `virtual void MyProto::Clear()':
bazel-out/local_linux-dbg/genfiles/my_proto.pb.cc:223: warning: this
decimal constant is unsigned only in ISO C90
The line in the proto file that was triggering it was:
if (_has_bits_[24 / 32] & 4278190080) {
ZR_(field1_, field2_);
}
_has_bits_ is a uint32. The constant mask should therefore be
unsigned. This change updates the constant to be generated as
unsigned.
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_message.cc')
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_message.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_message.cc b/src/google/protobuf/compiler/cpp/cpp_message.cc index bafa36f5..98929b1e 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -2096,7 +2096,7 @@ GenerateClear(io::Printer* printer) { } else { if (HasFieldPresence(descriptor_->file())) { printer->Print( - "if (_has_bits_[$index$ / 32] & $mask$) {\n", + "if (_has_bits_[$index$ / 32] & $mask$u) {\n", "index", SimpleItoa(i / 8 * 8), "mask", SimpleItoa(mask)); printer->Indent(); |