Re: [swift-dev] NSXMLNode.swift: error: integer literal overflows when stored into Int

2016-09-18 Thread william via swift-dev
I just noticed this thread.  I have an existing PR at 
https://github.com/apple/swift-corelibs-foundation/pull/603/files#diff-86379d50d0ad34b20bc3e4544e1b6f67R86
 that address this issue.  I have to remove some stuff that was addressed 
elsewhere before it can be merged, however.

I'll be working on that tomorrow, probably.

Cheers,
- Will

> On Sep 18, 2016, at 3:46 PM, Philippe Hausler via swift-dev 
>  wrote:
> 
> The reason for no issue on iOS 32 bit or watchOS is because the value is 
> calculated via NSUInteger which does not overflow at the sign bits like Int. 
> TBH I think the right way to solve this constant is to just emit the raw 
> value directly instead of attempting to emulate c with bitwise or.
> 
> Sent from my iPhone
> 
> On Sep 18, 2016, at 2:27 PM, Michael Gottesman  > wrote:
> 
>> 
>>> On Sep 16, 2016, at 4:37 PM, Eric Wing via swift-dev >> > wrote:
>>> 
>>> I'm trying to build Swift 3 for Raspberry Pi 2/armv7.
>>> 
>>> I'm currently hitting a compile error at:
>>> 
>>> Foundation/NSXMLNode.swift:86:351: error: integer literal '4293918720'
>>> overflows when stored into 'Int'.
>>> 
>>> public static let nodePreserveAll = Options(rawValue:
>>> Options([.nodePreserveNamespaceOrder, .nodePreserveAttributeOrder,
>>> .nodePreserveEntities, .nodePreservePrefixes, .nodePreserveCDATA,
>>> .nodePreserveEmptyElements, .nodePreserveQuotes,
>>> .nodePreserveWhitespace, .nodePreserveDTD,
>>> .nodePreserveCharacterReferences]).rawValue | UInt(bitPattern:
>>> 0xFFF0))
>>> 
>>> 
>>> I'm assuming this is probably related to the fact that the Pi2 (armv7)
>>> is 32-bit, though I'm surprised this isn't already seen on iOS 32-bit.
>>> What is the appropriate fix?
>> 
>> +CC Tony/Phillipe.
>> 
>>> 
>>> Thanks,
>>> Eric
>>> ___
>>> swift-dev mailing list
>>> swift-dev@swift.org 
>>> https://lists.swift.org/mailman/listinfo/swift-dev 
>>> 
>> 
> ___
> swift-dev mailing list
> swift-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

___
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev


Re: [swift-dev] NSXMLNode.swift: error: integer literal overflows when stored into Int

2016-09-18 Thread Philippe Hausler via swift-dev
The reason for no issue on iOS 32 bit or watchOS is because the value is 
calculated via NSUInteger which does not overflow at the sign bits like Int. 
TBH I think the right way to solve this constant is to just emit the raw value 
directly instead of attempting to emulate c with bitwise or.

Sent from my iPhone

> On Sep 18, 2016, at 2:27 PM, Michael Gottesman  wrote:
> 
> 
>> On Sep 16, 2016, at 4:37 PM, Eric Wing via swift-dev  
>> wrote:
>> 
>> I'm trying to build Swift 3 for Raspberry Pi 2/armv7.
>> 
>> I'm currently hitting a compile error at:
>> 
>> Foundation/NSXMLNode.swift:86:351: error: integer literal '4293918720'
>> overflows when stored into 'Int'.
>> 
>> public static let nodePreserveAll = Options(rawValue:
>> Options([.nodePreserveNamespaceOrder, .nodePreserveAttributeOrder,
>> .nodePreserveEntities, .nodePreservePrefixes, .nodePreserveCDATA,
>> .nodePreserveEmptyElements, .nodePreserveQuotes,
>> .nodePreserveWhitespace, .nodePreserveDTD,
>> .nodePreserveCharacterReferences]).rawValue | UInt(bitPattern:
>> 0xFFF0))
>> 
>> 
>> I'm assuming this is probably related to the fact that the Pi2 (armv7)
>> is 32-bit, though I'm surprised this isn't already seen on iOS 32-bit.
>> What is the appropriate fix?
> 
> +CC Tony/Phillipe.
> 
>> 
>> Thanks,
>> Eric
>> ___
>> swift-dev mailing list
>> swift-dev@swift.org
>> https://lists.swift.org/mailman/listinfo/swift-dev
> 
___
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev


Re: [swift-dev] NSXMLNode.swift: error: integer literal overflows when stored into Int

2016-09-18 Thread Michael Gottesman via swift-dev

> On Sep 16, 2016, at 4:37 PM, Eric Wing via swift-dev  
> wrote:
> 
> I'm trying to build Swift 3 for Raspberry Pi 2/armv7.
> 
> I'm currently hitting a compile error at:
> 
> Foundation/NSXMLNode.swift:86:351: error: integer literal '4293918720'
> overflows when stored into 'Int'.
> 
> public static let nodePreserveAll = Options(rawValue:
> Options([.nodePreserveNamespaceOrder, .nodePreserveAttributeOrder,
> .nodePreserveEntities, .nodePreservePrefixes, .nodePreserveCDATA,
> .nodePreserveEmptyElements, .nodePreserveQuotes,
> .nodePreserveWhitespace, .nodePreserveDTD,
> .nodePreserveCharacterReferences]).rawValue | UInt(bitPattern:
> 0xFFF0))
> 
> 
> I'm assuming this is probably related to the fact that the Pi2 (armv7)
> is 32-bit, though I'm surprised this isn't already seen on iOS 32-bit.
> What is the appropriate fix?

+CC Tony/Phillipe.

> 
> Thanks,
> Eric
> ___
> swift-dev mailing list
> swift-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

___
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev


[swift-dev] NSXMLNode.swift: error: integer literal overflows when stored into Int

2016-09-16 Thread Eric Wing via swift-dev
I'm trying to build Swift 3 for Raspberry Pi 2/armv7.

I'm currently hitting a compile error at:

Foundation/NSXMLNode.swift:86:351: error: integer literal '4293918720'
overflows when stored into 'Int'.

public static let nodePreserveAll = Options(rawValue:
Options([.nodePreserveNamespaceOrder, .nodePreserveAttributeOrder,
.nodePreserveEntities, .nodePreservePrefixes, .nodePreserveCDATA,
.nodePreserveEmptyElements, .nodePreserveQuotes,
.nodePreserveWhitespace, .nodePreserveDTD,
.nodePreserveCharacterReferences]).rawValue | UInt(bitPattern:
0xFFF0))


I'm assuming this is probably related to the fact that the Pi2 (armv7)
is 32-bit, though I'm surprised this isn't already seen on iOS 32-bit.
What is the appropriate fix?

Thanks,
Eric
___
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev