diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2025-12-25 21:28:14 +0100 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2025-12-25 21:34:00 +0100 |
| commit | 98c3d868fb5a7da7356c58e8c51423975bbd078b (patch) | |
| tree | 682d1e0137008b32587818a5d588391cbc879ce6 /sbin | |
| parent | 5629b5cf79934e0b94ddbbd93b7756f74fe4050a (diff) | |
fsck_msdosfs: avoid warnings about too-long initializer strings
Mark `dot_name` and `dotdot_name` as as `__non_string`, to avoid
warnings from clang 21 similar to:
sbin/fsck_msdosfs/dir.c:466:39: 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]
466 | static const u_char dot_name[11] = ". ";
| ^~~~~~~~~~~~~
sbin/fsck_msdosfs/dir.c:467:39: 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]
467 | static const u_char dotdot_name[11] = ".. ";
| ^~~~~~~~~~~~~
MFC after: 3 days
Diffstat (limited to 'sbin')
| -rw-r--r-- | sbin/fsck_msdosfs/dir.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/fsck_msdosfs/dir.c b/sbin/fsck_msdosfs/dir.c index 19516d882e2a..2d7e4bcdc38f 100644 --- a/sbin/fsck_msdosfs/dir.c +++ b/sbin/fsck_msdosfs/dir.c @@ -463,8 +463,8 @@ checksize(struct fat_descriptor *fat, u_char *p, struct dosDirEntry *dir) return FSOK; } -static const u_char dot_name[11] = ". "; -static const u_char dotdot_name[11] = ".. "; +static const u_char dot_name[11] __nonstring = ". "; +static const u_char dotdot_name[11] __nonstring = ".. "; /* * Basic sanity check if the subdirectory have good '.' and '..' entries, |
