Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Dec 2025 00:22:35 +0000
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: ba0a11512237 - main - makefs: avoid warnings about too-long initializer strings
Message-ID:  <694dd54b.3306a.451e7252@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by dim:

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

commit ba0a11512237681fc621670023d56195cb8c82ad
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2025-12-26 00:22:03 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2025-12-26 00:22:18 +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
---
 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 */


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?694dd54b.3306a.451e7252>