From 2a3511a0dfa517a8936ed1ff6942935b203bfdcc Mon Sep 17 00:00:00 2001 From: Peter Dillinger Date: Thu, 4 Nov 2021 14:59:37 -0700 Subject: [PATCH] Fix -Werror=type-limits seen in Travis (#9128) Summary: Work around annoying compiler warning-as-error from https://github.com/facebook/rocksdb/issues/9113 Pull Request resolved: https://github.com/facebook/rocksdb/pull/9128 Test Plan: CI Reviewed By: jay-zhuang Differential Revision: D32181499 Pulled By: pdillinger fbshipit-source-id: d7e5f7857a29f7ba47c49c3aee7150b5763b65d9 --- options/options_helper.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/options/options_helper.h b/options/options_helper.h index ec84c467f..4ba5d3a94 100644 --- a/options/options_helper.h +++ b/options/options_helper.h @@ -31,7 +31,10 @@ std::vector GetSupportedDictCompressions(); std::vector GetSupportedChecksums(); inline bool IsSupportedChecksumType(ChecksumType type) { - return type >= kNoChecksum && type <= kXXH3; + // Avoid annoying compiler warning-as-error (-Werror=type-limits) + auto min = kNoChecksum; + auto max = kXXH3; + return type >= min && type <= max; } // Checks that the combination of DBOptions and ColumnFamilyOptions are valid -- GitLab