Page MenuHomeFreeBSD

netbsd-tests t_regex_att: Use __nonstring for a non-string constant
AcceptedPublic

Authored by jhb on Sun, Jan 25, 4:54 AM.

Details

Reviewers
emaste
dim
ngie
imp
Summary

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";
   |                              ^~~~~~~~

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 70121
Build 67004: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Sun, Jan 25, 10:35 AM

LGTM. Weird that I didn't see this one with clang 21, which also has the same warnings about __nonstring. But maybe I just didn't run this test?