nasa / CF

The Core Flight System (cFS) CFDP application.
Apache License 2.0
77 stars 45 forks source link

CF Build failure on systems where int32 is "long" #317

Closed jphickey closed 2 years ago

jphickey commented 2 years ago

Checklist (Please check before submitting)

Describe the bug On a system where the int32 type is defined as long (rather than int), the CF unit tests fail to build with the following error:

/home/joe/code/cfecfs/github/apps/cf/unit-test/cf_codec_tests.c: In function 'Test_CF_CFDP_DecodeHeader':
/home/joe/code/cfecfs/github/apps/cf/unit-test/cf_codec_tests.c:730:5: error: format '%d' expects argument of type 'int', but argument 6 has type 'int32' [-Werror=format=]
     UtAssert_True(ret_val == CFE_SUCCESS, "CF_CFDP_DecodeHeader returned %d and should be 0", ret_val);
     ^
/home/joe/code/cfecfs/github/apps/cf/unit-test/cf_codec_tests.c:748:5: error: format '%d' expects argument of type 'int', but argument 6 has type 'int32' [-Werror=format=]
     UtAssert_True(ret_val == CFE_SUCCESS, "CF_CFDP_DecodeHeader returned %d and should be 0", ret_val);
     ^
/home/joe/code/cfecfs/github/apps/cf/unit-test/cf_codec_tests.c:755:5: error: format '%d' expects argument of type 'int', but argument 6 has type 'int32' [-Werror=format=]
     UtAssert_True(ret_val == -1, "CF_CFDP_DecodeHeader returned %d and should be -1", ret_val);
     ^
/home/joe/code/cfecfs/github/apps/cf/unit-test/cf_codec_tests.c:762:5: error: format '%d' expects argument of type 'int', but argument 6 has type 'int32' [-Werror=format=]
     UtAssert_True(ret_val == -1, "CF_CFDP_DecodeHeader returned %d and should be -1", ret_val);
     ^

To Reproduce Build on any system where int32 is not equivalent to int

Expected behavior Should build successfully

System observed on: RTEMS

Additional context This is using UtAssert_True - problem would not exist if the UtAssert_INT32_EQ were used as intended.

Reporter Info Joseph Hickey, Vantage Systems, Inc.

skliper commented 2 years ago

Maybe we should add a label for unit test bugs? Or just use the unit-test label? I'd prefer to use bug for operational software issues.