Skip to content

Commit 4dec7e9

Browse files
silence pvs warnings
1 parent 9f22bb4 commit 4dec7e9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

applications/debug/crash_test/crash_test.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static void crash_test_corrupt_heap_underflow(void) {
3535

3636
#pragma GCC diagnostic push
3737
#pragma GCC diagnostic ignored "-Wstringop-overflow" // that's what we want!
38-
memset(block - underflow_size, 0xDD, underflow_size);
38+
memset(block - underflow_size, 0xDD, underflow_size); // -V769
3939
#pragma GCC diagnostic pop
4040

4141
free(block); // should crash here (if compiled with DEBUG=1)
@@ -49,15 +49,15 @@ static void crash_test_corrupt_heap_overflow(void) {
4949
const size_t overflow_size = 123;
5050
uint8_t* block1 = malloc(block_size);
5151
uint8_t* block2 = malloc(block_size);
52-
memset(block2, 12, 34); // simulate use to avoid optimization
52+
memset(block2, 12, 34); // simulate use to avoid optimization // -V597 // -V1086
5353

5454
#pragma GCC diagnostic push
5555
#pragma GCC diagnostic ignored "-Wstringop-overflow" // that's what we want!
56-
memset(block1 + block_size, 0xDD, overflow_size);
56+
memset(block1 + block_size, 0xDD, overflow_size); // -V769 // -V512
5757
#pragma GCC diagnostic pop
5858

5959
uint8_t* block3 = malloc(block_size);
60-
memset(block3, 12, 34); // simulate use to avoid optimization
60+
memset(block3, 12, 34); // simulate use to avoid optimization // -V597 // -V1086
6161

6262
free(block3); // should crash here (if compiled with DEBUG=1)
6363
free(block2);

furi/core/memmgr_heap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
#include <core/log.h>
4646
#include <core/common_defines.h>
4747

48+
// -V::562
49+
// -V::650
50+
4851
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
4952
* all the API functions to use the MPU wrappers. That should only be done when
5053
* task.h is included from an application file. */

0 commit comments

Comments
 (0)