diff options
author | Takayuki Matsuoka <t-mat@users.noreply.github.com> | 2022-08-12 14:48:43 (GMT) |
---|---|---|
committer | Takayuki Matsuoka <t-mat@users.noreply.github.com> | 2022-08-12 14:49:22 (GMT) |
commit | 0fc36f1bc758e3d66cbbf863a5701d0ec006cd1a (patch) | |
tree | b81b72c68fe88f384b5af5850914553a0d8701f8 /lib | |
parent | 5e22228e88340ec05cd9b3e275ef7a81af2709e8 (diff) | |
download | lz4-0fc36f1bc758e3d66cbbf863a5701d0ec006cd1a.zip lz4-0fc36f1bc758e3d66cbbf863a5701d0ec006cd1a.tar.gz lz4-0fc36f1bc758e3d66cbbf863a5701d0ec006cd1a.tar.bz2 |
Suppress false positive warning from MSVC
MSVC (17.3 or earlier) reports the following warning
lz4\lib\lz4.c(527): warning C6385: Reading invalid data from 'v'.
Line 527 is : LZ4_memcpy(&v[4], v, 4);
But, obviously v[0..3] is always filled with meaningful value.
Therefore, this warning report is wrong.
We must revisit this issue with future version of MSVC.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/lz4.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -524,7 +524,14 @@ LZ4_memcpy_using_offset(BYTE* dstPtr, const BYTE* srcPtr, BYTE* dstEnd, const si case 2: LZ4_memcpy(v, srcPtr, 2); LZ4_memcpy(&v[2], srcPtr, 2); +#if defined(_MSC_VER) && (_MSC_VER <= 1933) /* MSVC 2022 ver 17.3 or earlier */ +# pragma warning(push) +# pragma warning(disable : 6385) /* warning C6385: Reading invalid data from 'v'. */ +#endif LZ4_memcpy(&v[4], v, 4); +#if defined(_MSC_VER) && (_MSC_VER <= 1933) /* MSVC 2022 ver 17.3 or earlier */ +# pragma warning(pop) +#endif break; case 4: LZ4_memcpy(v, srcPtr, 4); |