cppcheck/test/testsuites/duma/wrong6.c

20 lines
317 B
C
Raw Normal View History

2019-03-18 06:58:12 +01:00
#include <stdio.h>
struct Test {
2021-08-07 20:51:18 +02:00
int a;
char st[10];
2019-03-18 06:58:12 +01:00
};
int main() {
2021-08-07 20:51:18 +02:00
printf("Hello world!\n");
2019-03-18 06:58:12 +01:00
2021-08-07 20:51:18 +02:00
struct Test ar[10];
struct Test b;
printf("Let's index out of bounds \n");
ar[10].a=10;
printf("Did you notice?\n");
printf("There should be 1 error in this run\n");
return 0;
2019-03-18 06:58:12 +01:00
}