HardenedBSD Services pushed to branch hardened/current/master at HardenedBSD / HardenedBSD
Commits:
98c3d868 by Dimitry Andric at 2025-12-25T21:34:00+01:00
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
- - - - -
ecb58f93 by Igor Ostapenko at 2025-12-25T20:41:22+00:00
kyua: Fix prompt of "debug -p" command
- - - - -
ba0a1151 by Dimitry Andric at 2025-12-26T01:22:18+01:00
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
- - - - -
a3394b6a by Dimitry Andric at 2025-12-26T01:30:36+01:00
m4: avoid warnings about too-long initializer strings
Mark `digits` as `__non_string`, to avoid warnings from clang 21 similar
to:
usr.bin/m4/misc.c:123:27: error: initializer-string for character array is too long, array size is 36 but initializer has size 37 (including the null terminating character); did you mean to use the 'nonstring' attribute? [-Werror,-Wunterminated-string-initialization]
123 | static char digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MFC after: 3 days
- - - - -
38b803e3 by HardenedBSD Sync Services at 2025-12-25T18:01:30-07:00
Merge branch 'freebsd/current/main' into hardened/current/master
- - - - -
4 changed files:
- contrib/kyua/cli/cmd_debug.cpp
- sbin/fsck_msdosfs/dir.c
- usr.bin/m4/misc.c
- usr.sbin/makefs/msdos/direntry.h
Changes:
=====================================
contrib/kyua/cli/cmd_debug.cpp
=====================================
@@ -91,14 +91,14 @@ class dbg : public engine::debugger {
_ui->out("The test failed and paused right before its cleanup "
"routine.");
_ui->out(F("Test work dir: %s") % eh.work_directory().str());
- _ui->out("Press any key to continue...");
+ _ui->out("Press <Enter> to continue...");
(void) std::cin.get();
}
} else if (_cmdline.has_option(pause_before_cleanup_option
.long_name())) {
_ui->out("The test paused right before its cleanup routine.");
_ui->out(F("Test work dir: %s") % eh.work_directory().str());
- _ui->out("Press any key to continue...");
+ _ui->out("Press <Enter> to continue...");
(void) std::cin.get();
}
};
=====================================
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,
=====================================
usr.bin/m4/misc.c
=====================================
@@ -120,7 +120,8 @@ pbnum(int n)
void
pbnumbase(int n, int base, int d)
{
- static char digits[36] = "0123456789abcdefghijklmnopqrstuvwxyz";
+ static char digits[36] __nonstring =
+ "0123456789abcdefghijklmnopqrstuvwxyz";
unsigned int num;
int printed = 0;
=====================================
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 */
View it on GitLab:
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/compare/3288a8e8c00328d5c6dddc5ee6a9dfa8e4fce885...38b803e352f377cad000b4a74886d345128023d1
--
View it on GitLab:
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/compare/3288a8e8c00328d5c6dddc5ee6a9dfa8e4fce885...38b803e352f377cad000b4a74886d345128023d1
You're receiving this email because of your account on
git.hardenedbsd.org.