You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When compiling on RTEMS this application now has multiple warnings:
/home/joe/code/cfecfs/github/apps/sample_app/fsw/src/sample_app.c: In function 'SAMPLE_AppInit':
/home/joe/code/cfecfs/github/apps/sample_app/fsw/src/sample_app.c:166:30: error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'int32' [-Werror=format=]
status);
^
/home/joe/code/cfecfs/github/apps/sample_app/fsw/src/sample_app.c:187:30: error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'int32' [-Werror=format=]
status);
^
/home/joe/code/cfecfs/github/apps/sample_app/fsw/src/sample_app.c:199:30: error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'int32' [-Werror=format=]
status);
^
/home/joe/code/cfecfs/github/apps/sample_app/fsw/src/sample_app.c:211:30: error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'int32' [-Werror=format=]
status);
^
/home/joe/code/cfecfs/github/apps/sample_app/fsw/src/sample_app.c:226:9: error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'int32' [-Werror=format=]
CFE_ES_WriteToSysLog("Sample App: Error Registering \
^
/home/joe/code/cfecfs/github/apps/sample_app/fsw/src/sample_app.c: In function 'SAMPLE_GetCrc':
/home/joe/code/cfecfs/github/apps/sample_app/fsw/src/sample_app.c:535:9: error: format '%X' expects argument of type 'unsigned int', but argument 2 has type 'uint32' [-Werror=format=]
CFE_ES_WriteToSysLog("Sample App: CRC: 0x%08X\n\n", Crc);
^
To Reproduce
Build on RTEMS per the readme/howto and with -Wall -Werror switches
Expected behavior
Should build clean
System observed on:
Ubuntu 18.04 (build host) when cross compiling for RTEMS 4.11
Additional context
Appears the problem calls were introduced in #1
As a rule of thumb, whenever "printf" style conversions are used in conjunction with the fixed-width types (int32, uint32, etc) these need an explicit cast because the actual type definitions vary by platform.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
When using printf-style format conversions one must generally
cast the argument to the intended type, as it does not happen
implicitly with variable-argument functions.
In particular the existing code worked on the default (native) build
but generated warnings when building on RTEMS for a 32-bit x86 target.
When using printf-style format conversions one must generally
cast the argument to the intended type, as it does not happen
implicitly with variable-argument functions.
In particular the existing code worked on the default (native) build
but generated warnings when building on RTEMS for a 32-bit x86 target.
Describe the bug
When compiling on RTEMS this application now has multiple warnings:
To Reproduce
Build on RTEMS per the readme/howto and with
-Wall -Werror
switchesExpected behavior
Should build clean
System observed on:
Ubuntu 18.04 (build host) when cross compiling for RTEMS 4.11
Additional context
Appears the problem calls were introduced in #1
As a rule of thumb, whenever "printf" style conversions are used in conjunction with the fixed-width types (int32, uint32, etc) these need an explicit cast because the actual type definitions vary by platform.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: