AnsweredAssumed Answered

New installation CW10.6, casting errors (printf cant show negative values)

Question asked by Carl Norman on May 14, 2015
Latest reply on May 14, 2015 by Carl Norman

Code snippet:

    printf("test result = %i\r\n", 0xFF);

    printf("test result = %i\r\n", (char)0xFF);

 

Simple code that I have run on my cygwin gcc, codepad.org and visual studio all return the expected result:

 

test result = 255

test result = -1

 

Run this code on my new MQX4.1.1 build with up to date CW10.6 (win7 64bit) and get:

 

test result = 255

test result = 255

 

Problem is this worked on my old windows build (also a fresh installation), so what changed? what setting could affect this?

 

Obviously I have dumbed this down but this is a serious probelm for my code which has been working on MQX4.1.1 up to date, and now has stopped (all i did was rebuild my computer and fresh install this).

Outcomes