Skip to content
This repository was archived by the owner on Mar 24, 2018. It is now read-only.
This repository was archived by the owner on Mar 24, 2018. It is now read-only.

INT64_MAX, INT64_MIN, possibly others, initialized wrong on OS X's ruby #14

Description

@srh

In lib/protobuf/message/field.rb, there's some constants set up like this:

      INT32_MAX  =  2**31 - 1
      INT32_MIN  = -2**31
      INT64_MAX  =  2**63 - 1
      INT64_MIN  = -2**63
      UINT32_MAX =  2**32 - 1
      UINT64_MAX =  2**64 - 1

The problem is that with OS X's ruby (on Mountain Lion, anyway), we get this:

$ /usr/bin/ruby -e 'puts 2**63'
-9223372036854775808

Yep. Its ruby can't do math good. The ruby --version is ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0].

It would be very nice if all these expressions were replaced by hard-coded integer literals.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions