From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202606 header.b=IkNii9LE; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 717DC5A026E for ; Sun, 19 Jul 2026 06:21:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202606; t=1784434863; bh=Of5JlWLgxa5gPreyJPdFcj2okMV6CL+aeMOLRQDKer8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IkNii9LEH/CSTufBE+yJJ7gSpuX5pwJe6hPq69ENWW01maoqsyNDVyT+NQpzpRjwV 938H3lUQ/bCD//HyhLtTvChNEKSzfdBpA7+68xcbNfFgaO2myqpuRRtkplOOp0JzVC QP7Q1qu9kR0F1V8waSpWmk/fKtRHSTWeLKCpHpu3Z4Ng6j+rbdIG6dUZEku3lYwHgQ xl47BlpkZJcHctuClbD4HCR/cjhBlOiniFQYC0V0HjGFDUPHTnEcKmfFNuUr9Fx3Fc KXmUFCmpgtEgbB7uYf4q5oOdKSUKur5dmSwqO/yb/JLKEPEUUXxQz5LbcC0NM5ReRW RzKHZVODcuc0A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4h2r730cydz4w2F; Sun, 19 Jul 2026 14:21:03 +1000 (AEST) Date: Sun, 19 Jul 2026 14:05:27 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] pif: Add message to static_assert for C11 compliance, fix build with gcc 8 Message-ID: References: <20260718074134.1330908-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RWfPeG++bncgruvr" Content-Disposition: inline In-Reply-To: <20260718074134.1330908-1-sbrivio@redhat.com> Message-ID-Hash: 5LBG4NBRF5DXJMKXA2IPYJLUNXKF7P3I X-Message-ID-Hash: 5LBG4NBRF5DXJMKXA2IPYJLUNXKF7P3I X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --RWfPeG++bncgruvr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 18, 2026 at 09:41:34AM +0200, Stefano Brivio wrote: > Seen with gcc 8.5: >=20 > --- > In file included from passt.h:18, > from qrap.c:36: > pif.h: In function 'pif_type': > pif.h:48:44: error: expected ',' before ')' token > static_assert(sizeof("?") <=3D PIF_NAME_SIZE); > ^ > make: *** [Makefile:105: qrap] Error 1 > --- >=20 > As noted in ba84a3b17af8 ("treewide: Add messages to static_assert() > calls"), static_assert() calls need a message to comply with C11. The > form without message is supported starting from C23 only. >=20 > Fixes: cbcd4284111f ("pif: Limit pif names to 128 bytes") > Signed-off-by: Stefano Brivio Huh. Weird I didn't get a warning for this one, I've caught this same mistake a bunch of times before because of a warning, though I forget if it came from the compiler or one of the static checkers. In any case, Reviewed-by: David Gibson > --- > pif.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/pif.h b/pif.h > index 3a1e2e5..dedcaa5 100644 > --- a/pif.h > +++ b/pif.h > @@ -45,7 +45,7 @@ static inline const char *pif_type(enum pif_type pt) > return pif_type_str[pt]; > else > return "?"; > - static_assert(sizeof("?") <=3D PIF_NAME_SIZE); > + static_assert(sizeof("?") <=3D PIF_NAME_SIZE, "PIF_NAME_SIZE too small"= ); > } > =20 > static inline const char *pif_name(uint8_t pif) > --=20 > 2.43.0 >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --RWfPeG++bncgruvr Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmpcTQYACgkQzQJF27ox 2GevMQ//a2G/lv/ZhbPL7R1g9fX6g2WhkbStbakeXpoNri3mGBBVVVZGzC/OkUqc biTK3GOLysc6ebpaTjh9M3G8VrTxI0demV7XoTBpQAls7oxao0f6KtC+sDkSVfbu WskEtZ0xIrXXnSpsMS+MjMPBLfxxd1Cydcw6vrUCknp8Wq72gbMEVl+GbbAlRxo4 z/+vxhNPmz5O9NELWYutOe1dT3MuWAno4WkqwpCPazm6cPHHQvO8QadXyqBqBiLe gKLSVOBXd6CLbifNE6b9cBMfXPXjYCbynyKh+RB3/dpWIPV9/jCorRzRFVb7JjaU OSeOjZl3dzQ3gKD6iyb7Pg/G31XJ3ejFgAjcJUMgXUXgWstI5p7XliEPOQzoNAwq puqpBwx9DTvQvh2PVYwcDUuhUHv2PKSq0Fbum1IroSzuyCmiGbJnbUDi/yfJHqmk chnc8ukNvhc0oPbZPNxRW1VG4WI363KYani2ojNP3Dg4qRX2VYpvlDq0nCIBbAA3 ik/DDDBiMwk/8SW2/sfYMUmdrqSFZUvM+8UOdx9oIQJT3oIQUJP6nZekdFRFnza3 Kg+Z69l09In+qNpGFTvP5pFf6Bcs7+8t0r3nHQJ/Fj0kUYi1Sc8kBaMCt2jGUQoU qCTVNVL5bWGuECQhJUnmt8LXnzFtFPWfRgNuApz/9yXulSkpLGA= =M42+ -----END PGP SIGNATURE----- --RWfPeG++bncgruvr--