[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-devel] [Win32] localtime_r() bug
From: |
goldsimon |
Subject: |
Re: [lwip-devel] [Win32] localtime_r() bug |
Date: |
Wed, 21 Feb 2018 16:19:42 +0100 |
User-agent: |
K-9 Mail for Android |
Fixed, thanks for reporting.
Simon
Gisle Vanem wrote:
>While building lwIP.dll + unit-tests using clang-cl 5.0,
>I got this very important warning:
>
>../../src/contrib/ports/win32/check/time.c(98,42) : warning: 'memcpy'
>call operates on objects of type 'struct tm'
>while the size is based on a different type 'struct tm *'
>[-Wsizeof-pointer-memaccess]
> memcpy (result, local_result, sizeof (result));
> ~~~~~~ ^~~~~~
>
>It should be:
>
>--- a/src/contrib/ports/win32/check/time.c 2016-12-12 14:02:50
>+++ b/src/contrib/ports/win32/check/time.c 2018-02-21 14:55:23
>@@ -59,6 +95,7 @@
> if (local_result == NULL || result == NULL)
> return NULL;
>
>- memcpy(result, local_result, sizeof (result));
>+ memcpy (result, local_result, sizeof (*result));
> return result;
> }