SwiftDigest icon indicating copy to clipboard operation
SwiftDigest copied to clipboard

Integer overflows

Open linhdh opened this issue 6 years ago • 4 comments

building for Ipad MC775ZP/A with IOS version 9.3.5 (13G36) is failed with errors:

Integer literal '4023233417' overflows when store into 'UInt32'
Integer literal '2562383102' overflows when store into 'UInt32'

at lines:

var b = UInt32(0xefcdab89)
var c = UInt32(0x98badcfe)

linhdh avatar Mar 10 '18 01:03 linhdh

Look at my workaround in Issues #1

ghost avatar Mar 10 '18 14:03 ghost

I also have a pull request in with the same fix

ghost avatar Mar 10 '18 14:03 ghost

Hi man, you just need change

    var a = UInt32(0x67452301)
    var b = UInt32(0xefcdab89)
    var c = UInt32(0x98badcfe)
    var d = UInt32(0x10325476)

to

    var a: UInt32 = 0x67452301
    var b: UInt32 = 0xefcdab89
    var c: UInt32 = 0x98badcfe
    var d: UInt32 = 0x10325476

all errors should go away.

raymond-liao avatar Mar 20 '18 06:03 raymond-liao

gaoshanyu's answer solves my problem.

linhdh avatar Mar 30 '18 03:03 linhdh