From patchwork Thu Mar 11 22:33:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1451563 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=i/JGHRz2; 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 4DxNyp6cKPz9sSC for ; Fri, 12 Mar 2021 09:33:54 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A42D23952535; Thu, 11 Mar 2021 22:33:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A42D23952535 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1615502028; bh=O1IIhT+jG93d+786k1zoHGoO4jhbBlDsMn7B+La2pVA=; 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=i/JGHRz2uIi+1HIZOf0RxCjey7AKMsnN8jHBhDPRNKgdnfvJX6SFku52aN/3W0ejM vzohNFyRjh1MGAjT583DYTrJeo4tGIU9g0XQi6RxhkUcDbpuidn/E7WO6yysyMtc7z IDsO0lG/G7G1QPqTuvkxZNmwH0xMLA86sSoRtrwo= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id C3334395181A for ; Thu, 11 Mar 2021 22:33:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C3334395181A Received: by mail-wr1-x434.google.com with SMTP id w11so3694717wrr.10 for ; Thu, 11 Mar 2021 14:33:43 -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=O1IIhT+jG93d+786k1zoHGoO4jhbBlDsMn7B+La2pVA=; b=YX4e2fHHPZz3dJzKgV0YOGsJ7HTqqhzdSV0ZRJkuH0lUj7rmM23DbVaASZ6M8hZJLH QmD824WE6Un7GT6OKYFB1UKLbJowbbOcZtBIHSJSqf/j34aO2m/V1LsmyZxjjjX+8pAQ nAzsw9fZgnVmVLhUdD+vaCW/4YrtffBaqXRoDtuHQd4GdOP05hdidUMc3Usyq/1dCIks YTuez+mgdpJXu6lXa1x7sAWeJd+75xKXlhxmK2AhUwT23TYhpQ/Khv9Dh9HMXHRSjwJ1 8pkZ1AiGWAXuIKwMXLhIxfz4Kp4p3UKITvlTmA/tU4BdybavOSUHZUj9Nn3yFZRX4Hxp jSuA== X-Gm-Message-State: AOAM532c1ij9ci78j07fmd9/46+ueVyxfJbqLw0joy+xumhmzblMR7e6 CmsI1e1fLhME8Fe+lN8wMzk= X-Google-Smtp-Source: ABdhPJyNjm5BYeI+sLAdLEnPDwYyL1TJkC0VFyItKnoLGIlPvgAD6fa9RAczQNX7pADcTr3q0VntJw== X-Received: by 2002:a5d:6049:: with SMTP id j9mr10755654wrt.117.1615502022965; Thu, 11 Mar 2021 14:33:42 -0800 (PST) Received: from localhost.localdomain ([170.253.36.171]) by smtp.googlemail.com with ESMTPSA id v2sm22365771wmj.1.2021.03.11.14.33.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 14:33:42 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 01/17] scanf.3: SYNOPSIS: Use 'restrict' in prototypes; ffix too. Date: Thu, 11 Mar 2021 23:33:14 +0100 Message-Id: <20210311223330.722437-2-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210311223330.722437-1-alx.manpages@gmail.com> References: <20210311223330.722437-1-alx.manpages@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 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 scanf(), fscanf(), sscanf(), vscanf(), vfscanf(), vsscanf(). Let's use it here too. .../glibc$ grep_glibc_prototype scanf libio/stdio.h:397: extern int scanf (const char *__restrict __format, ...) __wur; .../glibc$ grep_glibc_prototype fscanf libio/stdio.h:391: extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __wur; .../glibc$ grep_glibc_prototype sscanf libio/stdio.h:399: extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __THROW; .../glibc$ grep_glibc_prototype vscanf libio/stdio.h:443: extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) __wur; .../glibc$ grep_glibc_prototype vfscanf libio/stdio.h:435: extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) __wur; .../glibc$ grep_glibc_prototype vsscanf libio/stdio.h:447: extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __THROW __attribute__ ((__format__ (__scanf__, 2, 0))); .../glibc$ Also reorder v* functions to match the order of non-v functions. Signed-off-by: Alejandro Colomar --- man3/scanf.3 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/man3/scanf.3 b/man3/scanf.3 index f353f1d4d..aefc262ab 100644 --- a/man3/scanf.3 +++ b/man3/scanf.3 @@ -56,15 +56,19 @@ scanf, fscanf, sscanf, vscanf, vsscanf, vfscanf \- input format conversion .nf .B #include .PP -.BI "int scanf(const char *" format ", ...);" -.BI "int fscanf(FILE *" stream ", const char *" format ", ...);" -.BI "int sscanf(const char *" str ", const char *" format ", ...);" +.BI "int scanf(const char *restrict " format ", ...);" +.BI "int fscanf(FILE *restrict " stream , +.BI " const char *restrict " format ", ...);" +.BI "int sscanf(const char *restrict " str , +.BI " const char *restrict " format ", ...);" .PP .B #include .PP -.BI "int vscanf(const char *" format ", va_list " ap ); -.BI "int vsscanf(const char *" str ", const char *" format ", va_list " ap ); -.BI "int vfscanf(FILE *" stream ", const char *" format ", va_list " ap ); +.BI "int vscanf(const char *restrict " format ", va_list " ap ); +.BI "int vfscanf(FILE *restrict " stream , +.BI " const char *restrict " format ", va_list " ap ); +.BI "int vsscanf(const char *restrict " str , +.BI " const char *restrict " format ", va_list " ap ); .fi .PP .RS -4