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

Marked another compiler literal unsigned. #468

Merged
merged 1 commit into from Jun 6, 2015

Conversation

AustinSchuh
Copy link

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.

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.
xfxyjwf added a commit that referenced this pull request Jun 6, 2015
Marked another compiler literal unsigned.
@xfxyjwf xfxyjwf merged commit b9baa47 into protocolbuffers:master Jun 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants