Hello together,
while compiling snap7, I got this warning:
In file included from /usr/include/string.h:495, from /usr/include/c++/9/cstring:42, from ../../src/sys/snap_platform.h:100, from ../../src/sys/snap_msgsock.h:29, from ../../src/sys/snap_tcpsrvr.h:29, from ../../src/core/s7_server.h:29, from ../../src/core/s7_server.cpp:26: In function ‘void* memcpy(void*, const void*, size_t)’, inlined from ‘void TS7Worker::SZLSystemState()’ at ../../src/core/s7_server.cpp:1247:11: /usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:33: warning: ‘void* __builtin_memcpy(void*, const void*, long unsigned int)’ reading 6 bytes from a region of size 4 [-Wstringop-overflow=] 34 | return __builtin___memcpy_chk (__dest, __src, __len, __bos0 (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
g++: 9.3.0 OS: Ubuntu
Hi
I have the same warning. There is a typo in TS7Worker::SZLSystemState():
TS7Worker::SZLSystemState()
--- a/src/core/s7_server.cpp +++ b/src/core/s7_server.cpp @@ -1244,7 +1244,7 @@ void TS7Worker::SZLSystemState() { SZL.Answer.Header.DataLen=SwapWord(sizeof(SZLSysState)); SZL.ResParams->Err =0x0000; - memcpy(SZL.ResData,&SZLNotAvail,sizeof(SZLSysState)); + memcpy(SZL.ResData,&SZLSysState,sizeof(SZLSysState)); isoSendBuffer(&SZL.Answer,28); SZL.SZLDone=true; }
Log in to post a comment.
Hello together,
while compiling snap7, I got this warning:
g++: 9.3.0
OS: Ubuntu
Hi
I have the same warning.
There is a typo in
TS7Worker::SZLSystemState():