From dcaa3a1417feda7a6e71bd878450124c8ed53eb7 Mon Sep 17 00:00:00 2001 From: Daniel Kahn Gillmor Date: Wed, 8 Oct 2025 10:49:44 -0400 Subject: [PATCH] Avoid returning enum in boolean context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this fix, when compiling with `ENABLE_CRYPTO_REFRESH`, we see: ``` …/src/lib/enc_material.cpp: In member function ‘virtual bool pgp::X25519EncMaterial::parse(pgp_packet_body_t&)’: …/src/lib/enc_material.cpp:154:20: warning: enum constant in boolean context [-Wint-in-bool-context] 154 | return RNP_ERROR_BAD_FORMAT; | ^~~~~~~~~~~~~~~~~~~~ make[3]: Leaving directory '…/build' ``` --- src/lib/enc_material.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/enc_material.cpp b/src/lib/enc_material.cpp index 3e8250afe9..6e12b72ed7 100644 --- a/src/lib/enc_material.cpp +++ b/src/lib/enc_material.cpp @@ -151,7 +151,7 @@ X25519EncMaterial::parse(pgp_packet_body_t &pkt) noexcept uint8_t bt = 0; if (!pkt.get(bt)) { RNP_LOG("failed to get salg"); - return RNP_ERROR_BAD_FORMAT; + return false; } sess_len--; salg = (pgp_symm_alg_t) bt;