aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2026-07-18 07:03:38 +0200
committerStefano Brivio <sbrivio@redhat.com>2026-07-21 12:08:10 +0200
commit316cb2e74751ca1bffbb265cd8531126f5a74aa2 (patch)
tree09cdd77a1f186ef2d0c1bb9527a7e12b442adcb3
parent81a99ce3e73bde052f792d52d260eef5b2a821a8 (diff)
downloadpasst-316cb2e74751ca1bffbb265cd8531126f5a74aa2.tar
passt-316cb2e74751ca1bffbb265cd8531126f5a74aa2.tar.gz
passt-316cb2e74751ca1bffbb265cd8531126f5a74aa2.tar.bz2
passt-316cb2e74751ca1bffbb265cd8531126f5a74aa2.tar.lz
passt-316cb2e74751ca1bffbb265cd8531126f5a74aa2.tar.xz
passt-316cb2e74751ca1bffbb265cd8531126f5a74aa2.tar.zst
passt-316cb2e74751ca1bffbb265cd8531126f5a74aa2.zip
pif: Add message to static_assert for C11 compliance, fix build with gcc 8
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 <sbrivio@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
-rw-r--r--pif.h2
1 files changed, 1 insertions, 1 deletions
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)