aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2025-12-26 00:22:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2025-12-26 00:22:18 +0000
commitba0a11512237681fc621670023d56195cb8c82ad (patch)
treef66819b8bc20c3f2d22b06a87700e353fc82bcc1
parentecb58f931d45d6fe4e8b60a172415cc387657a6b (diff)
makefs: avoid warnings about too-long initializer strings
Mark `direntry::deName` as `__non_string`, to avoid warnings from clang 21 similar to: usr.sbin/makefs/msdos/msdosfs_vnops.c:512:4: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization] 512 | { ". ", /* the . entry */ | ^~~~~~~~~~~~~ usr.sbin/makefs/msdos/msdosfs_vnops.c:522:4: error: initializer-string for character array is too long, array size is 11 but initializer has size 12 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization] 522 | { ".. ", /* the .. entry */ | ^~~~~~~~~~~~~ MFC after: 3 days
-rw-r--r--usr.sbin/makefs/msdos/direntry.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/makefs/msdos/direntry.h b/usr.sbin/makefs/msdos/direntry.h
index 9d6c65dfcc7d..675a70e26474 100644
--- a/usr.sbin/makefs/msdos/direntry.h
+++ b/usr.sbin/makefs/msdos/direntry.h
@@ -55,7 +55,7 @@
* Structure of a dos directory entry.
*/
struct direntry {
- uint8_t deName[11]; /* filename, blank filled */
+ uint8_t deName[11] __nonstring; /* filename, blank filled */
#define SLOT_EMPTY 0x00 /* slot has never been used */
#define SLOT_E5 0x05 /* the real value is 0xe5 */
#define SLOT_DELETED 0xe5 /* file in this slot deleted */