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
There are a few remaining warnings in the unit test stubs and test cases when compiling on an architecture that has strict alignment requirements.
To Reproduce
Build with ENABLE_UNIT_TESTS=true on a platform that requires strict alignment (e.g. SPARC, MIPS, etc).
Expected behavior
Should compile cleanly
Code snips
Example error (first one to appear in my build):
/home/joe/code/cfecfs/github/cfe/fsw/cfe-core/ut-stubs/ut_es_stubs.c: In function ‘CFE_ES_GetPoolBuf’:
/home/joe/code/cfecfs/github/cfe/fsw/cfe-core/ut-stubs/ut_es_stubs.c:420:23: error: cast increases required alignment of target type [-Werror=cast-align]
*BufPtr = (uint32 *)PoolPtr;
^
cc1: all warnings being treated as errors
System observed on:
Ubuntu 20.04, cross compiling for MIPS CPU.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Resolve remaining alignment warnings in the unit test and stub code.
In es_UT.c test cases were passing a char* as a stack pointer (uint32*)
Memory pool code was also using uint8[] buffer as uint32.
Most casting becomes unnecessary when defined as the correct type.
Resolve remaining alignment warnings in the unit test and stub code.
In es_UT.c test cases were passing a char* as a stack pointer (uint32*)
Memory pool code was also using uint8[] buffer as uint32.
Most casting becomes unnecessary when defined as the correct type.
Describe the bug
There are a few remaining warnings in the unit test stubs and test cases when compiling on an architecture that has strict alignment requirements.
To Reproduce
Build with ENABLE_UNIT_TESTS=true on a platform that requires strict alignment (e.g. SPARC, MIPS, etc).
Expected behavior
Should compile cleanly
Code snips
Example error (first one to appear in my build):
System observed on:
Ubuntu 20.04, cross compiling for MIPS CPU.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: