diff options
author | Austin Schuh <austin@peloton-tech.com> | 2015-06-05 22:46:01 -0700 |
---|---|---|
committer | Austin Schuh <austin@peloton-tech.com> | 2015-06-05 22:46:01 -0700 |
commit | 307af628e646cd67e659f327e549542c0f5e31b7 (patch) | |
tree | fba88b384ea6c70fd46edccd412e81e81430a77d /src/google/protobuf/compiler/cpp/cpp_message.cc | |
parent | 68975a4e5071c5159258770edceec925e73ca2de (diff) | |
download | protobuf-307af628e646cd67e659f327e549542c0f5e31b7.tar.gz protobuf-307af628e646cd67e659f327e549542c0f5e31b7.tar.bz2 protobuf-307af628e646cd67e659f327e549542c0f5e31b7.zip |
Marked another compiler literal unsigned.
When compiling a protobuf with gcc 4.1.2 for powerpc, I ran into
another of 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 212fe2e1..af85919a 100644 --- a/src/google/protobuf/compiler/cpp/cpp_message.cc +++ b/src/google/protobuf/compiler/cpp/cpp_message.cc @@ -3510,7 +3510,7 @@ GenerateByteSize(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), "mask", SimpleItoa(mask)); printer->Indent(); |