lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [Win32] localtime_r() bug


From: Gisle Vanem
Subject: [lwip-devel] [Win32] localtime_r() bug
Date: Wed, 21 Feb 2018 16:11:46 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

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;
 }

--
--gv

--
--gv



reply via email to

[Prev in Thread] Current Thread [Next in Thread]