tests/fault_handler: Suppress cppcheck errors
This code is supposed to hit the null pointer. tests/fault_handler/main.c:43: error (nullPointer): Null pointer dereference: (volatile unsigned int*)(0x00000000u) tests/fault_handler/main.c:44: error (nullPointer): Null pointer dereference: (volatile unsigned int*)(0x00000000u)
This commit is contained in:
parent
e5d60176e4
commit
46f599c1a9
@ -36,11 +36,14 @@
|
|||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
puts("Fault handler test application");
|
puts("Fault handler test application");
|
||||||
printf("This application will crash by attempting to write to address 0x%08x\n", FORBIDDEN_ADDRESS);
|
printf("This application will crash by attempting to write to address 0x%08x\n",
|
||||||
|
FORBIDDEN_ADDRESS);
|
||||||
puts("Waiting 1 second before crashing...");
|
puts("Waiting 1 second before crashing...");
|
||||||
xtimer_usleep(1000000lu);
|
xtimer_usleep(1000000lu);
|
||||||
puts("Write to forbidden address " PRINT_MACRO(FORBIDDEN_ADDRESS));
|
puts("Write to forbidden address " PRINT_MACRO(FORBIDDEN_ADDRESS));
|
||||||
|
/* cppcheck-suppress nullPointer */
|
||||||
*((volatile unsigned int *) FORBIDDEN_ADDRESS) = 12345u;
|
*((volatile unsigned int *) FORBIDDEN_ADDRESS) = 12345u;
|
||||||
|
/* cppcheck-suppress nullPointer */
|
||||||
unsigned int readback = *((volatile unsigned int *) FORBIDDEN_ADDRESS);
|
unsigned int readback = *((volatile unsigned int *) FORBIDDEN_ADDRESS);
|
||||||
printf("readback: 0x%08x\n", readback);
|
printf("readback: 0x%08x\n", readback);
|
||||||
puts("We did not expect the application to survive the previous write.");
|
puts("We did not expect the application to survive the previous write.");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user