$ clang -g out_boounds_array.c -o bin/out_bounds_array
out_boounds_array.c:6:20: warning: array index 4 is past the end of the array
(which contains 4 elements) [-Warray-bounds]
printf("%d\n", arr[4]);
^ ~
out_boounds_array.c:4:5: note: array 'arr' declared here
int arr[] = {0, 1, 2, 3};
^
1 warning generated.
配列外アクセスして怒られるコード(out_bounds_arr.c)を用意してみた。
実行してみたけど、怒られなかった.....