smadaminov / ovs-dpdk-meson-issues

VMware Summer 2021
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

windows meson: 'write' is deprecated: The POSIX name for this item is deprecated. #27

Open williamtu opened 3 years ago

williamtu commented 3 years ago
Command line for building ['lib\\libopenvswitch.a'] is long, using a response file
[1/252] Compiling C object lib/libopenvswitch.a.p/byteq.c.obj
FAILED: lib/libopenvswitch.a.p/byteq.c.obj
"clang" "-Ilib\libopenvswitch.a.p" "-Ilib" "-I..\lib" "-I." "-I.." "-Iinclude\openflow" "-I..\include\openflow" "-Iinclude\openvswitch" "-I..\include\openvsw
itch" "-I..\include\windows" "-Iinclude" "-I..\include" "-I..\datapath-windows\include" "-IC:\PTHREADS-BUILT\include" "-Xclang" "-fcolor-diagnostics" "-pipe"
 "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-g" "-Wthread-safety" "-Werror" "-dM" "-U_MSC_VER" -MD -MQ lib/libopenvswitch.a.p/byteq.c.obj -MF "lib\lib
openvswitch.a.p\byteq.c.obj.d" -o lib/libopenvswitch.a.p/byteq.c.obj "-c" ../lib/byteq.c
../lib/byteq.c:119:21: error: 'write' is deprecated: The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _write. See
online help for details. [-Werror,-Wdeprecated-declarations]
        ssize_t n = write(fd, byteq_tail(q), byteq_tailroom(q));
                    ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt_io.h:557:24: note: 'write' has been explicitly marked deprecated here
        _Check_return_ _CRT_NONSTDC_DEPRECATE(_write)
                       ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h:335:50: note: expanded from macro '_CRT_NONSTDC_DEPRECATE'
        #define _CRT_NONSTDC_DEPRECATE(_NewName) _CRT_DEPRECATE_TEXT(             \
                                                 ^
C:\BuildTools\VC\Tools\MSVC\14.29.30037\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
                                              ^
../lib/byteq.c:138:21: error: 'read' is deprecated: The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _read. See on
line help for details. [-Werror,-Wdeprecated-declarations]
        ssize_t n = read(fd, byteq_head(q), byteq_headroom(q));
                    ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt_io.h:522:9: note: 'read' has been explicitly marked deprecated here
        _CRT_NONSTDC_DEPRECATE(_read)
        ^
C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\ucrt\corecrt.h:335:50: note: expanded from macro '_CRT_NONSTDC_DEPRECATE'
        #define _CRT_NONSTDC_DEPRECATE(_NewName) _CRT_DEPRECATE_TEXT(             \
                                                 ^
C:\BuildTools\VC\Tools\MSVC\14.29.30037\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
williamtu commented 3 years ago

use

define _CRT_SECURE_NO_WARNINGS

define _CRT_SECURE_NO_DEPRECATE

add_global_arguments('-D_CRT_NONSTDC_NO_DEPRECATE', language : 'c')

williamtu commented 3 years ago

and _CRT_SECURE_NO_DEPRECATE