[PATCH v1 15/35] posix/regex.h: Use __restrict_arr and remove _Restrict_arr_

Alejandro Colomar alx@kernel.org
Sun Nov 9 21:53:24 GMT 2025


Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 posix/regex.h | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/posix/regex.h b/posix/regex.h
index bd1d941f38..f33368562a 100644
--- a/posix/regex.h
+++ b/posix/regex.h
@@ -638,18 +638,12 @@ extern int re_exec (const char *);
 
 /* For the ISO C99 syntax
      array_name[restrict]
-   use glibc's __restrict_arr if available.
-   Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode).
-   Other ISO C99 compilers support it as well.  */
-#ifndef _Restrict_arr_
-# ifdef __restrict_arr
-#  define _Restrict_arr_ __restrict_arr
+   use glibc's __restrict_arr if available.  */
+#ifndef __restrict_arr
+# if defined __cplusplus
+#  define __restrict_arr
 # else
-#  if !defined __cplusplus
-#   define _Restrict_arr_ __restrict
-#  else
-#   define _Restrict_arr_
-#  endif
+#  define __restrict_arr  __restrict
 # endif
 #endif
 
@@ -660,7 +654,7 @@ extern int regcomp (regex_t *__restrict __preg,
 
 extern int regexec (const regex_t *__restrict __preg,
 		    const char *__restrict __String, size_t __nmatch,
-		    regmatch_t __pmatch[_Restrict_arr_
+		    regmatch_t __pmatch[__restrict_arr
 					_REGEX_NELTS (__nmatch)],
 		    int __eflags);
 
-- 
2.51.0



More information about the Libc-alpha mailing list