IBM Support

Testing long long variable results in incorrect when using MinGW

Technote (troubleshooting)


Attempts to test a long long variable using IBM Rational Test RealTime result in an unexpected value in the report.


You test MyVarLong in the following way.


All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

long long int MyVarLong;




The test truncated the obtained value to a 32-bits value.


Minimalist GNU for Windows (MinGW) uses the MSVCRT library for the printf format that Test RealTime uses.

Resolving the problem

You need to customize the MinGW Target Deployment Port to use the MSVCRT library.

To do so, use the Target Deployment Port Editor in Parser Settings > Header adaptation for C.

  1. 1. Verify if you have the following pragma in
    Parser Settings > Header adaptation for C.

    #pragma attol sizeof(long) = 64

  2. Add the following code In Library Settings > Include files or code visible only to the Target Deployment Port.

    #define _MSC_VER 1400

Document information

More support for: Rational Test RealTime
Component Testing: C

Software version: 7.5,,,,,,, 8.0,,,

Operating system(s): Windows

Reference #: 1612988

Modified date: 19 April 2013