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 with strict aliasing mode (gcc w/ -O3 -fstrict-aliasing -Wstrict-aliasing=2), a warning gets triggered in vxworks-intLib-stubs.c as follows:
osal/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c: In function ‘OCS_INUM_TO_IVEC’:
osal/src/unit-test-coverage/ut-stubs/src/vxworks-intLib-stubs.c:60:61: error: dereferencing type-punned pointer might break strict-aliasing rules [-Werror=strict-aliasing]
60 | UT_GetDataBuffer(UT_KEY(OCS_INUM_TO_IVEC), (void **)&VecTbl, &VecTblSize, NULL);
| ^~~~~~~
cc1: all warnings being treated as errors
To Reproduce
Build with new-ish gcc (10.3) w/ -O3 -fstrict-aliasing -Wstrict-aliasing=2 options and tests enabled (so stubs are built).
Expected behavior
Should be clean.
System observed on:
Ubuntu
Additional context
Could be argued that stubs should not be built with optimization+strict aliasing rules, but the fix is relatively easy to avoid this warning.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered:
Describe the bug
When compiling with strict aliasing mode (gcc w/
-O3 -fstrict-aliasing -Wstrict-aliasing=2
), a warning gets triggered invxworks-intLib-stubs.c
as follows:To Reproduce
Build with new-ish gcc (10.3) w/
-O3 -fstrict-aliasing -Wstrict-aliasing=2
options and tests enabled (so stubs are built).Expected behavior
Should be clean.
System observed on:
Ubuntu
Additional context
Could be argued that stubs should not be built with optimization+strict aliasing rules, but the fix is relatively easy to avoid this warning.
Reporter Info
Joseph Hickey, Vantage Systems, Inc.
The text was updated successfully, but these errors were encountered: