Suppress cppcheck 1.89 false positive

cppcheck 1.89 emits a false positive for lib/isc/sha1.c:

    lib/isc/sha1.c:273:16: error: Uninitialized variable: block [uninitvar]
     (void)memmove(block, buffer, 64);
                   ^
    lib/isc/sha1.c:272:10: note: Assignment 'block=&workspace', assigned value is <Uninit>
     block = &workspace;
             ^
    lib/isc/sha1.c:273:16: note: Uninitialized variable: block
     (void)memmove(block, buffer, 64);
                   ^

This message started appearing with cppcheck 1.89 [1], but it will be
gone in the next release [2], so just suppress it for the time being.

[1] https://github.com/danmar/cppcheck/commit/af214e8212efa303e664920a468de00ee0b1fe3d

[2] https://github.com/danmar/cppcheck/commit/2595b826349a7ffbe1c958b806498b6e336bea33
This commit is contained in:
Michał Kępień
2019-10-17 11:13:30 +02:00
parent cb982f9225
commit cacba609c7
+1
View File
@@ -270,6 +270,7 @@ transform(uint32_t state[5], const unsigned char buffer[64]) {
INSIST(state != NULL);
block = &workspace;
/* cppcheck-suppress uninitvar */
(void)memmove(block, buffer, 64);
/* Copy context->state[] to working vars */