Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1199, correct warnings on gcc11 #1203

Merged
merged 1 commit into from
Jan 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/unit-test-coverage/portable/src/coveragetest-bsd-sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,10 @@ void Test_OS_SocketRecvFrom_Impl(void)

void Test_OS_SocketSendTo_Impl(void)
{
OS_object_token_t token = {0};
uint8 buffer[UT_BUFFER_SIZE];
OS_SockAddr_t addr = {0};
struct OCS_sockaddr *sa = (struct OCS_sockaddr *)&addr.AddrData;
OS_object_token_t token = {0};
const uint8 buffer[UT_BUFFER_SIZE] = {0};
OS_SockAddr_t addr = {0};
struct OCS_sockaddr *sa = (struct OCS_sockaddr *)&addr.AddrData;

/* Set up token */
token.obj_idx = UT_INDEX_0;
Expand Down Expand Up @@ -393,9 +393,9 @@ void Test_OS_SocketAddrToString_Impl(void)

void Test_OS_SocketAddrFromString_Impl(void)
{
char buffer[UT_BUFFER_SIZE];
OS_SockAddr_t addr = {0};
struct OCS_sockaddr *sa = (struct OCS_sockaddr *)&addr.AddrData;
const char buffer[UT_BUFFER_SIZE] = "UT";
OS_SockAddr_t addr = {0};
struct OCS_sockaddr *sa = (struct OCS_sockaddr *)&addr.AddrData;

/* Bad family */
sa->sa_family = -1;
Expand Down
6 changes: 3 additions & 3 deletions src/unit-test-coverage/shared/src/coveragetest-clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ void Test_OS_SetLocalTime(void)
* Test Case For:
* int32 OS_SetLocalTime(OS_time_t *time_struct)
*/
OS_time_t time_struct;
int32 expected = OS_SUCCESS;
int32 actual = OS_SetLocalTime(&time_struct);
OS_time_t time_struct = OS_TimeAssembleFromMicroseconds(5, 12345);
int32 expected = OS_SUCCESS;
int32 actual = OS_SetLocalTime(&time_struct);

UtAssert_True(actual == expected, "OS_SetLocalTime() (%ld) == OS_SUCCESS", (long)actual);

Expand Down
2 changes: 1 addition & 1 deletion src/unit-test-coverage/vxworks/src/coveragetest-tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void Test_OS_TaskDetach_Impl(void)
* Test Case For:
* int32 OS_TaskDetach_Impl(const OS_object_token_t *token)
*/
OS_object_token_t token;
OS_object_token_t token = UT_TOKEN_0;

/* no-op on VxWorks - always returns success */
OSAPI_TEST_FUNCTION_RC(OS_TaskDetach_Impl(&token), OS_SUCCESS);
Expand Down
2 changes: 1 addition & 1 deletion src/unit-tests/oscore-test/ut_oscore_task_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ void UT_os_task_get_info_test()
**--------------------------------------------------------------------------------*/
void UT_os_task_getid_by_sysdata_test()
{
uint8 sysdata;
uint8 sysdata = 0;
osal_id_t task_id;

/*
Expand Down