diff --git a/faiss/impl/ResultHandler.h b/faiss/impl/ResultHandler.h index 68574df0dc..ce15c63510 100644 --- a/faiss/impl/ResultHandler.h +++ b/faiss/impl/ResultHandler.h @@ -534,7 +534,7 @@ struct RangeSearchBlockResultHandler : BlockResultHandler { try { // finalize the partial result pres.finalize(); - } catch (const faiss::FaissException& e) { + } catch ([[maybe_unused]] const faiss::FaissException& e) { // Do nothing if allocation fails in finalizing partial results. #ifndef NDEBUG std::cerr << e.what() << std::endl; @@ -598,7 +598,7 @@ struct RangeSearchBlockResultHandler : BlockResultHandler { if (partial_results.size() > 0) { RangeSearchPartialResult::merge(partial_results); } - } catch (const faiss::FaissException& e) { + } catch ([[maybe_unused]] const faiss::FaissException& e) { // Do nothing if allocation fails in merge. #ifndef NDEBUG std::cerr << e.what() << std::endl;