From 05ade66682b3571d4b214a1c5b3dabab8b64e22c Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Tue, 8 Sep 2026 12:04:10 -0700 Subject: [PATCH] core: guard the multisession TOC declaration Declare the session-candidate TOC only when multisession support is enabled, matching the guard around its users. This fixes the unused variable error when ODFS_FEATURE_MULTISESSION=0 is built with -Werror. Compile the host library with multisession disabled in CI, using a separate output directory so default-build objects cannot hide the regression. --- .github/workflows/ci-build.yml | 5 +++++ core/mount.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 36ba36d..96a16e0 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -22,6 +22,11 @@ jobs: - name: Build and run host unit tests run: make check + - name: Build host library without multisession support + run: >- + make lib HOST_BUILD=build/host-no-multisession + CPPFLAGS=-DODFS_FEATURE_MULTISESSION=0 + - name: Run golden image tests run: make golden-check diff --git a/core/mount.c b/core/mount.c index 246c22b..0828419 100644 --- a/core/mount.c +++ b/core/mount.c @@ -58,7 +58,9 @@ static size_t mount_build_session_candidates(odfs_mount_t *mnt, uint32_t *starts, size_t max_starts) { +#if ODFS_FEATURE_MULTISESSION odfs_toc_t toc; +#endif size_t count = 0; if (!mnt || !starts || max_starts == 0)