Date: Tue, 27 Jan 2026 18:41:00 +0000 From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 2dea50a661b9 - main - netbsd-tests t_regex_att: Use __nonstring for a non-string constant Message-ID: <697906bc.20031.9a93dad@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=2dea50a661b903513efc42e270c4e6f5c2b89bc3 commit 2dea50a661b903513efc42e270c4e6f5c2b89bc3 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2026-01-27 18:38:31 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2026-01-27 18:38:31 +0000 netbsd-tests t_regex_att: Use __nonstring for a non-string constant Fixes the following warning from GCC 15: contrib/netbsd-tests/lib/libc/regex/t_regex_att.c:54:30: error: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (4 chars into 3 available) [-Werror=unterminated-string-initialization] 54 | static const char delim[3] = "\\\\\0"; | ^~~~~~~~ Reviewed by: ngie, imp, dim Differential Revision: https://reviews.freebsd.org/D54866 --- contrib/netbsd-tests/lib/libc/regex/t_regex_att.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c b/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c index dd5b818a1ef3..7962b1914f79 100644 --- a/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c +++ b/contrib/netbsd-tests/lib/libc/regex/t_regex_att.c @@ -51,7 +51,7 @@ __RCSID("$NetBSD: t_regex_att.c,v 1.3 2017/01/14 20:59:23 christos Exp $"); #include <vis.h> static const char sep[] = "\r\n\t"; -static const char delim[3] = "\\\\\0"; +static const char delim[3] __nonstring = "\\\\\0"; static voidhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?697906bc.20031.9a93dad>
