Skip to contentSkip to conversation

crypto: fix -std=c23 build failure

PATCH In review Rudi Heitbaum 2 participants 2 messages Nov 20, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 crypto: fix -std=c23 build failure

gcc-15 switched to -std=c23 by default:

    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

As a result iwd fails the build as:

../src/crypto.c:1215:24: error: incompatible types when returning type '_Bool' but 'struct l_ecc_point *' was expected
1215 | return false;
| ^~~~~

---
 src/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/crypto.c +1 -1
index 35941a2e..9dcdb43b 100644
@@ -1212,7 +1212,7 @@ struct l_ecc_point *crypto_derive_sae_pwe_from_pt_ecc(const uint8_t *mac1,
 	struct l_ecc_point *pwe;
 
 	if (!pt || !curve)
-		return false;
+		return NULL;
 
 	hash = crypto_sae_hash_from_ecc_prime_len(CRYPTO_SAE_HASH_TO_ELEMENT,
 					l_ecc_curve_get_scalar_bytes(curve));
Signature · 1 line
2.43.0
#1 lore raw

Hi Rudi,

Quoted 6 lines · Rudi Heitbaum

gcc-15 switched to -std=c23 by default:

     https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

As a result iwd fails the build as:

Quoted 9 lines

../src/crypto.c:1215:24: error: incompatible types when returning type '_Bool' but 'struct l_ecc_point *' was expected
1215 | return false;
| ^~~~~

---
  src/crypto.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Both applied, thanks.

Regards,
-Denis