From patchwork Wed Mar 10 18:31:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1450730 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=Tz1sUwOl; 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 4DwggP1RWRz9sS8 for ; Thu, 11 Mar 2021 05:33:05 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D05B53987C3E; Wed, 10 Mar 2021 18:32:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D05B53987C3E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615401141; bh=EqAyQylO8W1t/yhPmY8OxACFuG4Qjd3n9L9y54RJzuw=; 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=Tz1sUwOlKm/x1aMlXn0G0bE3qzZgSFiqdVwb2qaQhP7F3PKhIGVFrzULW4vcMc74H 2gW8yQWoYoRiQVGeCm3mhy2MFhqpXPZIEAwNFYPII1UZkBsjV1akvDPuf2VTEMf+OT gZj72vry8FdBCMyH1t1kGAEzfF8qu6KYHhDlV2JY= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 168A83987C2B for ; Wed, 10 Mar 2021 18:32:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 168A83987C2B Received: by mail-wr1-x42c.google.com with SMTP id w11so24454711wrr.10 for ; Wed, 10 Mar 2021 10:32:17 -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=EqAyQylO8W1t/yhPmY8OxACFuG4Qjd3n9L9y54RJzuw=; b=N5qclmdJryqHHTZRTzVNQRuPU6nREnlWANwinfBbXShonvG4BNU5iWe88sHaHQ6D1w weCzPPHF8gfFkZfPEmee7m1ewmH6EkO1PrBOWvHuEf5iKV/uxhoXjaeGY/JBrtUDMomW RMmGWF1Gae5Hf64ArzMEF13PxztVyqMZOhFeZdEE5RBylGWFONEcq+lfRDEmnTK9Wob5 1fiKJsTc3beOT8bg9BpDhunQT6L24kmlcHGjYd59PXLJlTeg/rvFjbhB6r50ZP66h5uo jSF7QqMJp/DJpIGQtFYvknHjDN7MrUX8MhjVnrh/f9LQ8aWxiVAl+A2cOpCtkSDUDe7v /npg== X-Gm-Message-State: AOAM531B8qATx8kawKziQjdviFBeMLOck9z/sz71Yhyu4AJfboEt/kJk cmNDJ6PVqswAzgV+Um/tkb0= X-Google-Smtp-Source: ABdhPJyR3FAr9vlFvhVAlIeNo2xbN1N0WqpHSEPDkdkwqKjPKXAGwGKCEeZZHrhjDQkhQHMz0KsyrA== X-Received: by 2002:adf:a59a:: with SMTP id g26mr4864188wrc.271.1615401136193; Wed, 10 Mar 2021 10:32:16 -0800 (PST) Received: from localhost.localdomain ([170.253.51.130]) by smtp.googlemail.com with ESMTPSA id k11sm325374wmj.1.2021.03.10.10.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Mar 2021 10:32:15 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 12/24] strcpy.3: SYNOPSIS: Use 'restrict' in prototypes Date: Wed, 10 Mar 2021 19:31:38 +0100 Message-Id: <20210310183149.194717-13-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1.721.g45526154a5 In-Reply-To: <20210310183149.194717-1-alx.manpages@gmail.com> References: <20210310183149.194717-1-alx.manpages@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 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 strcpy(), strncpy(). Let's use it here too. .../glibc$ grep_glibc_prototype strcpy string/string.h:125: extern char *strcpy (char *__restrict __dest, const char *__restrict __src) __THROW __nonnull ((1, 2)); .../glibc$ grep_glibc_prototype strncpy string/string.h:128: extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) __THROW __nonnull ((1, 2)); .../glibc$ Signed-off-by: Alejandro Colomar --- man3/strcpy.3 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man3/strcpy.3 b/man3/strcpy.3 index 46993cdb3..ade8b9412 100644 --- a/man3/strcpy.3 +++ b/man3/strcpy.3 @@ -39,8 +39,9 @@ strcpy, strncpy \- copy a string .nf .B #include .PP -.BI "char *strcpy(char *" dest ", const char *" src ); -.BI "char *strncpy(char *" dest ", const char *" src ", size_t " n ); +.BI "char *strcpy(char *restrict " dest ", const char *" src ); +.BI "char *strncpy(char *restrict " dest ", const char *restrict " src \ +", size_t " n ); .fi .SH DESCRIPTION The