Signing error Winrt

Monkey Forums/Monkey Bug Reports/Signing error Winrt

CopperCircle(Posted 2014) [#1]
I get this error with winrt:
error C4146: unary minus operator applied to unsigned type, result still unsigned.

Trans CPP Code:
t_lX8=t_lX&-2147483648;

Needs to be:
t_lX8=t_lX&-(int)2147483648;


marksibly(Posted 2014) [#2]
Sample code?


CopperCircle(Posted 2014) [#3]
Hi, this will do it:

Function Main:Int()
    Local blah:Int = -2147483648
    Return 0
End



marksibly(Posted 2014) [#4]
Ok, this can be 'fixed' by disabling 'security checks' in winrt c++ compiler options - but by 'fixed', I mean it'll generate a warning not an error.

I'll do this for the next release so you can at least use an 'int min' value, but there are still a few rough edges in Monkey to do with int constants that I need to look into longer term.

I'm not even sure if the above error is strictly correct in this case, as -2147483648 is a perfectly valid 32 bit signed int value - it's the smallest possible int (ie: $80000000). On the other hand, 2147483648 on it's own can't be stored in a signed int, so negating it is a no no. Guess you can look at it either way...


CopperCircle(Posted 2014) [#5]
Thanks Mark, getting just a warning will be much better :)