git: 43d41e72fa2d - stable/14 - makefs: avoid warnings about too-long initializer strings

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Mon, 29 Dec 2025 12:23:31 UTC
The branch stable/14 has been updated by dim:

URL: https://cgit.FreeBSD.org/src/commit/?id=43d41e72fa2d3365241346c8b122c1a5215f2723

commit 43d41e72fa2d3365241346c8b122c1a5215f2723
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2025-12-26 00:22:03 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2025-12-29 12:20:53 +0000

    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
    
    (cherry picked from commit ba0a11512237681fc621670023d56195cb8c82ad)
---
 usr.sbin/makefs/msdos/direntry.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 */