We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50efc9a commit 7b1ea16Copy full SHA for 7b1ea16
subsys/nrf_rpc/rpc_utils/server/crash_gen.c
@@ -15,7 +15,10 @@ K_WORK_DELAYABLE_DEFINE(crash_work, crash_work_handler);
15
16
static void do_stack_overflow(void)
17
{
18
- volatile uint8_t arr[(256 * 1024)] __attribute__((unused));
+ volatile uint8_t arr[CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE];
19
+
20
+ /* Write to 'arr' to prevent the compiler from optimizing it away. */
21
+ arr[0] = 1;
22
}
23
24
static void do_assert(void)
@@ -28,7 +31,9 @@ static void do_assert(void)
28
31
29
32
static void do_hardfault(void)
30
33
- volatile uint32_t value __attribute__((unused)) = 1 / 0;
34
+ volatile uint32_t value;
35
36
+ value = 1 / 0;
37
38
39
#pragma GCC diagnostic pop
0 commit comments