HomeFreeBSD

Fix unused variable warning in ffs_snapshot.c

Description

Fix unused variable warning in ffs_snapshot.c

With clang 15, the following -Werror warning is produced:

sys/ufs/ffs/ffs_snapshot.c:204:7: error: variable 'redo' set but not used [-Werror,-Wunused-but-set-variable]
        long redo = 0, snaplistsize = 0;
             ^

The 'redo' variable is only used when DIAGNOSTIC is defined. Ensure it
is only declared and set in that case.

MFC after: 3 days

(cherry picked from commit c9dde6f0c713a027266c52cf94a33a086348c566)

Details

Provenance
dimAuthored on Jul 26 2022, 7:30 PM
Parents
rGf9d12ca07182: Suppress -Wstrict-prototypes for several zlib files
Branches
Unknown
Tags
Unknown
Reverted By
rGf946e1f195eb: Revert "Fix unused variable warning in ffs_snapshot.c"