mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:48:24: warning: iteration 1 invokes undefined behavior [-Waggressive-loop-optimizations]
48 | punt[j]=punt[j+1]=p;
| ~~~~~~~~~^~
mushrooms.cpp:50:7: note: within this loop
50 | if(p==3) break;
| ^~
mushrooms.cpp:36:24: warning: iteration 1 invokes undefined behavior [-Waggressive-loop-optimizations]
36 | punt[j]=punt[j+1]=p;
| ~~~~~~~~~^~
mushrooms.cpp:38:7: note: within this loop
38 | if(p==0) break;
| ^~
mushrooms.cpp:48:23: warning: array subscript 4 is above array bounds of 'int [4]' [-Warray-bounds]
48 | punt[j]=punt[j+1]=p;
| ~~~~~~~~^
mushrooms.cpp:5:5: note: while referencing 'punt'
5 | int punt[4];
| ^~~~
mushrooms.cpp:48:23: warning: array subscript 6 is above array bounds of 'int [4]' [-Warray-bounds]
48 | punt[j]=punt[j+1]=p;
| ~~~~~~~~^
mushrooms.cpp:5:5: note: while referencing 'punt'
5 | int punt[4];
| ^~~~
mushrooms.cpp:48:13: warning: array subscript 5 is above array bounds of 'int [4]' [-Warray-bounds]
48 | punt[j]=punt[j+1]=p;
| ~~~~~~^
mushrooms.cpp:5:5: note: while referencing 'punt'
5 | int punt[4];
| ^~~~
mushrooms.cpp:36:23: warning: array subscript 4 is above array bounds of 'int [4]' [-Warray-bounds]
36 | punt[j]=punt[j+1]=p;
| ~~~~~~~~^
mushrooms.cpp:5:5: note: while referencing 'punt'
5 | int punt[4];
| ^~~~
mushrooms.cpp:36:23: warning: array subscript 6 is above array bounds of 'int [4]' [-Warray-bounds]
36 | punt[j]=punt[j+1]=p;
| ~~~~~~~~^
mushrooms.cpp:5:5: note: while referencing 'punt'
5 | int punt[4];
| ^~~~
mushrooms.cpp:36:13: warning: array subscript 5 is above array bounds of 'int [4]' [-Warray-bounds]
36 | punt[j]=punt[j+1]=p;
| ~~~~~~^
mushrooms.cpp:5:5: note: while referencing 'punt'
5 | int punt[4];
| ^~~~