[PATCH v1 14/35] posix/regex.h: Remove _Restrict_ macro

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


It's unconditionally defined as __restrict.  (Unless previously defined,
but that shouldn't happen.)

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

diff --git a/posix/regex.h b/posix/regex.h
index 4e4dcb8515..bd1d941f38 100644
--- a/posix/regex.h
+++ b/posix/regex.h
@@ -636,15 +636,6 @@ extern char *re_comp (const char *);
 extern int re_exec (const char *);
 #endif
 
-/* For plain 'restrict', use glibc's __restrict if defined.
-   Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
-   "restrict", and "configure" may have defined "restrict".
-   Other compilers use __restrict, __restrict__, and _Restrict, and
-   'configure' might #define 'restrict' to those words, so pick a
-   different name.  */
-#ifndef _Restrict_
-#  define _Restrict_ __restrict
-#endif
 /* For the ISO C99 syntax
      array_name[restrict]
    use glibc's __restrict_arr if available.
@@ -655,7 +646,7 @@ extern int re_exec (const char *);
 #  define _Restrict_arr_ __restrict_arr
 # else
 #  if !defined __cplusplus
-#   define _Restrict_arr_ _Restrict_
+#   define _Restrict_arr_ __restrict
 #  else
 #   define _Restrict_arr_
 #  endif
@@ -663,18 +654,18 @@ extern int re_exec (const char *);
 #endif
 
 /* POSIX compatibility.  */
-extern int regcomp (regex_t *_Restrict_ __preg,
-		    const char *_Restrict_ __pattern,
+extern int regcomp (regex_t *__restrict __preg,
+		    const char *__restrict __pattern,
 		    int __cflags);
 
-extern int regexec (const regex_t *_Restrict_ __preg,
-		    const char *_Restrict_ __String, size_t __nmatch,
+extern int regexec (const regex_t *__restrict __preg,
+		    const char *__restrict __String, size_t __nmatch,
 		    regmatch_t __pmatch[_Restrict_arr_
 					_REGEX_NELTS (__nmatch)],
 		    int __eflags);
 
-extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg,
-			char *_Restrict_ __errbuf, size_t __errbuf_size)
+extern size_t regerror (int __errcode, const regex_t *__restrict __preg,
+			char *__restrict __errbuf, size_t __errbuf_size)
     _Attr_access_ ((__write_only__, 3, 4));
 
 extern void regfree (regex_t *__preg);
-- 
2.51.0



More information about the Libc-alpha mailing list