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 compiler literal unsigned. #406

Merged
merged 1 commit into from May 20, 2015

Conversation

@AustinSchuh
Copy link
Contributor

@AustinSchuh AustinSchuh commented May 20, 2015

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.

Austin Schuh
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.
@googlebot googlebot added the cla: yes label May 20, 2015
@xfxyjwf
Copy link
Contributor

@xfxyjwf xfxyjwf commented May 20, 2015

Thanks for the fix!

xfxyjwf added a commit that referenced this pull request May 20, 2015
Marked compiler literal unsigned.
@xfxyjwf xfxyjwf merged commit 08ec9dc into protocolbuffers:master May 20, 2015
2 checks passed
2 checks passed
cla/google All necessary CLAs are signed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants