Skip to content
This repository has been 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

Open
srh opened this issue Mar 17, 2013 · 0 comments
Open

Comments

@srh
Copy link

srh commented Mar 17, 2013

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant