Checklist (Please check before submitting)
Describe the bug
Enabling -Wcast-align=strict with EDS build enabled results in cast alignment warnings due to EDS defined structures having different alignment than the native structures, specifically with CFE_SB_Buffer_t and EdsNativeBuffer_CFE_HDR_CommandHeader_t (as compared to CFE_MSG_CommandHeader_t for non-EDS builds)
To Reproduce
Steps to reproduce the behavior:
- Checkout
techdev-multitarget-bundle
- add
-Wcast-align=strict to arch_build_custom.cmake compile options
- remove
-Werror to see all the warnings
make native_eds.compile
Expected behavior
No cast alignment warnings
Code snips
example warnings:
nasa-cfs/tools/eds/cfecfs/edsmsg/fsw/src/edsmsg_dispatcher.c:296:19: error: cast increases required alignment of target type [-Werror=cast-align]
296 | DispatchTbl = (const CFE_EDSMSG_DispatchFunc_t *)MemAddr;
...
nasa-cfs/apps/hs/fsw/src/hs_monitors.c: In function ‘HS_MonitorEvent’:
nasa-cfs/apps/hs/fsw/src/hs_monitors.c:341:43: warning: cast increases required alignment of target type [-Wcast-align]
341 | SendPtr = (CFE_SB_Buffer_t *)&HS_AppData.MATablePtr[MsgActsIndex].MsgBuf;
| ^
nasa-cfs/apps/hs/fsw/src/hs_monitors.c: In function ‘HS_ValidateMATable’:
nasa-cfs/apps/hs/fsw/src/hs_monitors.c:755:23: warning: cast increases required alignment of target type [-Wcast-align]
755 | BufPtr = (CFE_SB_Buffer_t *)&TableArray[TableIndex].MsgBuf;
| ^
...
System observed on:
- Hardware: PC
- OS: Ubuntu 22.04 64bit
- Versions: v7.0.0
Additional context
Using GCC13
Reporter Info
Chris Fallon | ispace-US
Checklist (Please check before submitting)
Describe the bug
Enabling
-Wcast-align=strictwith EDS build enabled results in cast alignment warnings due to EDS defined structures having different alignment than the native structures, specifically withCFE_SB_Buffer_tandEdsNativeBuffer_CFE_HDR_CommandHeader_t(as compared toCFE_MSG_CommandHeader_tfor non-EDS builds)To Reproduce
Steps to reproduce the behavior:
techdev-multitarget-bundle-Wcast-align=stricttoarch_build_custom.cmakecompile options-Werrorto see all the warningsmake native_eds.compileExpected behavior
No cast alignment warnings
Code snips
example warnings:
System observed on:
Additional context
Using GCC13
Reporter Info
Chris Fallon | ispace-US