aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2025-12-26 14:31:43 +0000
committerDimitry Andric <dim@FreeBSD.org>2025-12-26 14:32:09 +0000
commite2c93ed09f259ed049923bdaa9b697b3586e2f1a (patch)
tree7fd6d4f9f5a59bdd55cb341e281d82a0d2541cce
parentcd880010c49a5d4ec529f4204d4e88cd27727255 (diff)
sys/font.h: avoid warnings about too-long initializer strings
Mark `font_header::fh_magic` as `__non_string`, to avoid a warning from clang 21 similar to: /usr/src/usr.bin/vtfontcvt/vtfontcvt.c:763:15: error: initializer-string for character array is too long, array size is 8 but initializer has size 9 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization] 763 | .fh_magic = FONT_HEADER_MAGIC, | ^~~~~~~~~~~~~~~~~ /usr/obj/usr/src/amd64.amd64/tmp/usr/include/sys/font.h:109:27: note: expanded from macro 'FONT_HEADER_MAGIC' 109 | #define FONT_HEADER_MAGIC "VFNT0002" | ^~~~~~~~~~ MFC after: 3 days
-rw-r--r--sys/sys/font.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sys/font.h b/sys/sys/font.h
index fb5fbbc9e557..d486dbc3a011 100644
--- a/sys/sys/font.h
+++ b/sys/sys/font.h
@@ -108,7 +108,7 @@ typedef STAILQ_HEAD(font_list, fontlist) font_list_t;
#define FONT_HEADER_MAGIC "VFNT0002"
struct font_header {
- uint8_t fh_magic[8];
+ uint8_t fh_magic[8] __nonstring;
uint8_t fh_width;
uint8_t fh_height;
uint16_t fh_pad;