From 73871f7653592b5e0a56991f766596b6231d86d8 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Thu, 13 Jun 2024 12:54:33 -0500 Subject: [PATCH] Silence spurious(?) ASAN warning on debian's gcc 12.2.0-14 on x86-64. It says "warning: 'regexec0' accessing 8 bytes in a region of size 4 [-Wstringop-overflow=]" but does not say where it's perceiving a region of size 4 from. (Yes, a compile-time warning, not runtime. It doesn't warn without ASAN=1, and changing the array argument to a pointer in the prototype makes gcc stop complaining.) --- lib/lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib.h b/lib/lib.h index 147bcf2f..23b1e680 100644 --- a/lib/lib.h +++ b/lib/lib.h @@ -262,7 +262,7 @@ struct group *bufgetgrgid(gid_t gid); int readlinkat0(int dirfd, char *path, char *buf, int len); int readlink0(char *path, char *buf, int len); int regexec0(regex_t *preg, char *string, long len, int nmatch, - regmatch_t pmatch[], int eflags); + regmatch_t *pmatch, int eflags); char *getusername(uid_t uid); char *getgroupname(gid_t gid); void do_lines(int fd, char delim, void (*call)(char **pline, long len)); -- 2.39.2