From patchwork Sun Nov 9 21:53:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123850 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F08D7385841B for ; Sun, 9 Nov 2025 22:07:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F08D7385841B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=cvd5EsI4 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [IPv6:2600:3c0a:e001:78e:0:1991:8:25]) by sourceware.org (Postfix) with ESMTPS id B9244385841C for ; Sun, 9 Nov 2025 21:53:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B9244385841C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B9244385841C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2600:3c0a:e001:78e:0:1991:8:25 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725204; cv=none; b=Zw0y+CzBWlhcyuT4SQLceHNWq6t9u8dyO453uBwV5hi6LCHBZauQ4LDy7b3MRrYl3u5YK2c0Vz5NH/yvzG3cvU84DeKb1kthdVXqm7/6wzuFeHgANBB6YZeSjnyiRN+mDOFLMMkLnDzz+scY1CpaAkWfyxytmzajPVRFX0aHGII= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725204; c=relaxed/simple; bh=QM/9GjIv4qEvr0MIKQpZMj8Y1NZ7oq1v9TEVRna+BVA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=PjgnrAh4ybvg+KH+dBCJC7oKK0Bm53R7/eh7BedqvQdNlYJ6+zZJ8vDTJeHLzkKW0G1jnWz91PdIRAlvu9MmgKJCfPlOEdBpBIebY64oUFSg+vYzRYmOYQWxLwwC84c2pLB8qf3Q9UFcsHR5gb6yDrfplwpbqLQrXww2nxnaAgE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B9244385841C Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 19520432C8 for ; Sun, 9 Nov 2025 21:53:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33017C2BC9E; Sun, 9 Nov 2025 21:53:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725203; bh=QM/9GjIv4qEvr0MIKQpZMj8Y1NZ7oq1v9TEVRna+BVA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cvd5EsI4Xcc0kqBqu3gUD6HH845ILUR692YvhoyZbzsqxwIlnX83yCk7WBj1UEj5t RH8VJ00MILU76ww6glFGmBSolqBaTML4C1iGwR+Oz0sOJwm0Eebr77af4HMSZUQgXv PllBM580Ei0LidoXBQcS4Dzfo86P6//LUfxrBl3Jt3rCXuEVmdMdUWazeN+ORKp413 jb/g7JdHEye1oRt6O/HZZEef2gYYtZnnxo2A3LvXX6HRGZhK0HwZZvQ0Yf5TM9ilX3 KA/nzMKJ3ZZPtlhf3VfZIyUmRF121CpoGGXkgzjyiuHWrSF0C057pg1QqCynCeGVt1 oIq01KGyp4Eig== Date: Sun, 9 Nov 2025 22:53:21 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 14/35] posix/regex.h: Remove _Restrict_ macro Message-ID: <131c9cba132392ee5da7652202da85207ff3f976.1762725057.git.alx@kernel.org> X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as __restrict. (Unless previously defined, but that shouldn't happen.) Signed-off-by: Alejandro Colomar --- 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);