Skip to content

Commit

Permalink
Merge pull request #1203 from jphickey/fix-1199-gcc11-warnings
Browse files Browse the repository at this point in the history
Fix #1199, correct warnings on gcc11

 # Please enter a commit message to explain why this merge is necessary,
  • Loading branch information
astrogeco committed Jan 19, 2022
2 parents 3d1a7e4 + e51cbe3 commit 17b7163
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
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

0 comments on commit 17b7163

Please sign in to comment.