From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 3D9BC5A0269; Sat, 18 Jul 2026 09:41:34 +0200 (CEST) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH] pif: Add message to static_assert for C11 compliance, fix build with gcc 8 Date: Sat, 18 Jul 2026 09:41:34 +0200 Message-ID: <20260718074134.1330908-1-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: IBAWGRU2GQGS4DZ6Z4YZ73MSGJJUEKUV X-Message-ID-Hash: IBAWGRU2GQGS4DZ6Z4YZ73MSGJJUEKUV X-MailFrom: sbrivio@passt.top 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: David Gibson 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: Seen with gcc 8.5: --- 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("?") <= PIF_NAME_SIZE); ^ make: *** [Makefile:105: qrap] Error 1 --- 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. Fixes: cbcd4284111f ("pif: Limit pif names to 128 bytes") Signed-off-by: Stefano Brivio --- pif.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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("?") <= PIF_NAME_SIZE); + static_assert(sizeof("?") <= PIF_NAME_SIZE, "PIF_NAME_SIZE too small"); } static inline const char *pif_name(uint8_t pif) -- 2.43.0