From 26492c0a14966c32c43cd6ca1d0dca5e62c6cfef Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Thu, 6 May 2021 10:56:25 -0600 Subject: Annotate additional APIs with GCC attribute access. This change continues the improvements to compile-time out of bounds checking by decorating more APIs with either attribute access, or by explicitly providing the array bound in APIs such as tmpnam() that expect arrays of some minimum size as arguments. (The latter feature is new in GCC 11.) The only effects of the attribute and/or the array bound is to check and diagnose calls to the functions that fail to provide a sufficient number of elements, and the definitions of the functions that access elements outside the specified bounds. (There is no interplay with _FORTIFY_SOURCE here yet.) Tested with GCC 7 through 11 on x86_64-linux. --- posix/bug-regex33.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'posix/bug-regex33.c') diff --git a/posix/bug-regex33.c b/posix/bug-regex33.c index 2140cda96a..86569465cf 100644 --- a/posix/bug-regex33.c +++ b/posix/bug-regex33.c @@ -105,7 +105,7 @@ do_test (void) /* 新処圭新, \xb7\xbd here really matches 圭, * this is a reproducer of bug-regex25 */ e = re_search (&r, "\xbf\xb7\xbd\xe8\xb7\xbd\xbf\xb7", - 10, 0, 10, &s); + 9, 0, 9, &s); if (e != 4) { printf ("bug-regex33.7: no match or false match: re_search() returned %d, should return 4\n", e); -- cgit 1.4.1