DF-1300 / build.sh
#!/bin/sh # -O0 REQUIRED: at -O2 gcc sees plane_states[MAX_SURFACES=3] and elides the # OOB iterations as UB (-faggressive-loop-optimizations). The kernel builds at # -O2 and MAY silently clamp the loop to 3 — which is itself worth noting (the # bug may be compiled out by the optimizer, but relying on that is fragile and # the correct fix is the explicit bounds check). -O0 shows the real overflow. set -e cd "$(dirname "$0")" cc -O0 -Wall -o harness harness.c echo "BUILD_EXIT=$?" ls -l harness |