From patchwork Mon Mar 8 18:53:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1449353 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=ob8IcrXA; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DvSGF3r1Cz9sW1 for ; Tue, 9 Mar 2021 05:55:33 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A869D3955418; Mon, 8 Mar 2021 18:54:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A869D3955418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615229671; bh=qrkMvIRKw7Ja85h9a/f2cq51bB7o7Y+L+GSYiapFpqc=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=ob8IcrXAcUv1aMs75lA8m+hOBsNzrCVxqav0wQmjeZs62BbTmgJqRmfCp0rfQMTr8 UtOOhmjZRjzZzNwfPgfUB0VmrXVGhjAzoyMKVdj413MxQkOX3sV2Pq8sGgjfD2Kg34 Qze6MFVx+tuO8xBPVPYIH+vMygJ+8qcECj9L6tio= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id 053F73955415 for ; Mon, 8 Mar 2021 18:54:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 053F73955415 Received: by mail-wm1-x335.google.com with SMTP id 124-20020a1c00820000b029010b871409cfso4435805wma.4 for ; Mon, 08 Mar 2021 10:54:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qrkMvIRKw7Ja85h9a/f2cq51bB7o7Y+L+GSYiapFpqc=; b=JwciKnBM/Fc7zCVvjRi6ieGi55erxLsh+UfSUI3sk7R/dsbRDDVTsRTOH2ssUV7XGz GDKFXaaSHyI/s3zh63OxFif9G9E3GANaTitRWuauwElxwIT7qOr1mjYIgxm1xxRTP/br Pyi6XaK2K+Jjf+ZrWIdf4VAJNqRAozQ+jKgj9CBdx7BVLvYWGRWZGmcjxdNr72xHmXQh GQARXlx08e1ReO+Sid7ON2otkzHQmZmZCpAdEV+PK1vWRKoZGOIvCCp7LAmbKD1ujvWr dK2d1gqwcgBY8715JKdvJEIvVSNbj4U4KF+lMcPJN6/MPrMiGGL16hPpeE4dSOknKhz5 fb6Q== X-Gm-Message-State: AOAM530lpwSSA0B8oTcbheR/y9EkBW2LXi/ba6UonO0kl2edSM2/wlBk SKOGRc4u9BffGmo2gBDIzRI= X-Google-Smtp-Source: ABdhPJxPTyzJRS+PEWTibo4iHMnyvzXpb3hOjQN01017PDN+qYwNy3eRymlCFH3or/l1P9GDXVrXAg== X-Received: by 2002:a1c:a745:: with SMTP id q66mr203873wme.21.1615229668254; Mon, 08 Mar 2021 10:54:28 -0800 (PST) Received: from sqli.sqli.com ([195.53.121.100]) by smtp.googlemail.com with ESMTPSA id i11sm19889921wro.53.2021.03.08.10.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 10:54:27 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 20/23] regex.3: SYNOPSIS: Use 'restrict' in prototypes Date: Mon, 8 Mar 2021 19:53:29 +0100 Message-Id: <20210308185331.242176-21-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210308185331.242176-1-alx.manpages@gmail.com> References: <20210308185331.242176-1-alx.manpages@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alejandro Colomar via Libc-alpha From: Alejandro Colomar Reply-To: Alejandro Colomar Cc: Alejandro Colomar , linux-man@vger.kernel.org, libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" Both POSIX and glibc use 'restrict' in regcomp(), regexec(), regerror(). Let's use it here too. .../glibc$ grep_glibc_prototype regcomp posix/regex.h:644: extern int regcomp (regex_t *_Restrict_ __preg, const char *_Restrict_ __pattern, int __cflags); .../glibc$ grep_glibc_prototype regexec posix/regex.h:648: extern int regexec (const regex_t *_Restrict_ __preg, const char *_Restrict_ __String, size_t __nmatch, regmatch_t __pmatch[_Restrict_arr_], int __eflags); .../glibc$ grep_glibc_prototype regerror posix/regex.h:653: extern size_t regerror (int __errcode, const regex_t *_Restrict_ __preg, char *_Restrict_ __errbuf, size_t __errbuf_size); .../glibc$ Signed-off-by: Alejandro Colomar --- man3/regex.3 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/man3/regex.3 b/man3/regex.3 index 79af42ff4..12e43b3f9 100644 --- a/man3/regex.3 +++ b/man3/regex.3 @@ -34,13 +34,15 @@ regcomp, regexec, regerror, regfree \- POSIX regex functions .nf .B #include .PP -.BI "int regcomp(regex_t *" preg ", const char *" regex ", int " cflags ); -.BI "int regexec(const regex_t *" preg ", const char *" string \ -", size_t " nmatch , -.BI " regmatch_t " pmatch[] ", int " eflags ); +.BI "int regcomp(regex_t *restrict " preg ", const char *restrict " regex , +.BI " int " cflags ); +.BI "int regexec(const regex_t *restrict " preg \ +", const char *restrict " string , +.BI " size_t " nmatch ", regmatch_t " pmatch "[restrict]\ +, int " eflags ); .PP -.BI "size_t regerror(int " errcode ", const regex_t *" preg ", char *" errbuf , -.BI " size_t " errbuf_size ); +.BI "size_t regerror(int " errcode ", const regex_t *restrict " preg , +.BI " char *restrict " errbuf ", size_t " errbuf_size ); .BI "void regfree(regex_t *" preg ); .fi .SH DESCRIPTION