fix build-error when -Werror=unused-but-set-variable is enabled