Skip to content

Unable to build pendulum for 32bit #784

@hesstobi

Description

@hesstobi
  • [ x] I am on the latest Pendulum version.
  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • OS version and name: Linux 32bit
  • Pendulum version: 3.0.0

Issue

Trying to build pendulum for a 32bit system fails:

-> src/helpers.rs:59:20
         |
      59 |         seconds += ((146_097 - 10957) * SECS_PER_DAY as usize) as isize;
         |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ attempt to compute `135140_usize * 86400_usize`, which would overflow
         |
         = note: `#[deny(arithmetic_overflow)]` on by default

usize is only a 32 uint on 32 bit systems, thus this is not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions