Testing long long variable results in incorrect when using MinGW

Technote (troubleshooting)


Problem(Abstract)

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

Symptom

You test MyVarLong in the following way.

Disclaimer

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;

VAR MyVarLong, long#h64, init = 0xAAAAAAAAAAAAAAAALL, ev = 0x0FFFFFFFFFFFFFFFL



EXPECTED


OBTAINED


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

Cause

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






Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

Rational Test RealTime
Component Testing: C

Software version:

7.5, 7.5.0.1, 7.5.0.2, 7.5.0.3, 7.5.0.4, 7.5.0.5, 7.5.0.6, 8.0, 8.0.0.1, 8.0.0.2, 8.0.0.3

Operating system(s):

Windows

Reference #:

1612988

Modified date:

2013-04-19

Translate my page

Machine Translation

Content navigation