spaxel/firmware/test
jedarden 7b6a3d89b2 test(runner): volatile-qualify setjmp loop index for -Wclobbered-clean build (bf-2k3o)
The per-test loop in main() spans the setjmp(g_test_jmp)/longjmp recovery
target: i is read (loop test + increment) on the longjmp-return path. gcc's
-Wclobbered (enabled under -Wall) flags exactly this loop-index-across-setjmp
shape. The build was clean today only coincidentally — the preceding qsort()
call biases gcc's register heuristic; an identical loop without it warns at
-O1/-O2 (verified). Qualify i as volatile per C11 7.13.2.1, the sanctioned
remedy (no pragma, no flag downgrade), with no behavior change. This is the
compile-cleanliness gate for the guard (parent bf-22vg).

Verified: gcc -std=c11 -Wall -Wextra -Wclobbered -Werror is clean at
-O0/-O1/-O2/-O3/-Os/-Og; make -C firmware/test test builds warning-free and
runs all 30 tests (exit 0). Only firmware/test/test_runner.c touched.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-04 02:29:01 -04:00
..
.gitignore test: land firmware host-test build scaffolding (Makefile, .gitignore, sanity) 2026-07-03 11:56:34 -04:00
Makefile test: land firmware host-test build scaffolding (Makefile, .gitignore, sanity) 2026-07-03 11:56:34 -04:00
test_csi_frame.c test: add firmware host tests for nvs/csi/serial_prov + wire gcc harness into CI 2026-07-03 13:21:26 -04:00
test_nvs_migration.c test: add firmware host tests for nvs/csi/serial_prov + wire gcc harness into CI 2026-07-03 13:21:26 -04:00
test_runner.c test(runner): volatile-qualify setjmp loop index for -Wclobbered-clean build (bf-2k3o) 2026-07-04 02:29:01 -04:00
test_runner.h test: add firmware host harness header — TEST() macro + assert macros 2026-07-03 06:57:58 -04:00
test_sanity.c test: land firmware host-test build scaffolding (Makefile, .gitignore, sanity) 2026-07-03 11:56:34 -04:00
test_serial_prov.c test: add firmware host tests for nvs/csi/serial_prov + wire gcc harness into CI 2026-07-03 13:21:26 -04:00