From patchwork Wed Feb 24 14:42:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 1443905 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=8.43.85.97; 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=JRE8aQ4/; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 4DlzFf5Cy2z9sRN for ; Thu, 25 Feb 2021 01:44:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5FE8B3950409; Wed, 24 Feb 2021 14:44:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5FE8B3950409 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614177844; bh=TKb5SxYeSQZIL/cLkRICHkolXAAl+45MgBm7VlSyIC8=; 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=JRE8aQ4/2n/umlJkN2mLvu2mNQoH3XFzIwqFV09BU2vwWXFmp7S3tVVYWMu2muIN6 C6DXYkB10QAhOBDVxcfZxLC8A08QsvjmuxseO9RLtAMG08ldkNVbh1nbYkhBepvEq/ /jB2DBpkaq3gc1v76WqyTPnb/TgzoOH9x7jXTCjs= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id ABDCA394EC21 for ; Wed, 24 Feb 2021 14:44:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org ABDCA394EC21 Received: by mail-wm1-x32c.google.com with SMTP id n4so616499wmq.3 for ; Wed, 24 Feb 2021 06:44:01 -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=TKb5SxYeSQZIL/cLkRICHkolXAAl+45MgBm7VlSyIC8=; b=ub8SRhhd54ZjIiaWsOI2f/p4Mvpp9fjXDA9EQ065abvTfIeq2TlDSkAQhGa4n/rJaE Hm+SlcvGch3G8g/s2kwpbEtKBxOOb4KXnY1/7ZHj5XoD3uP/fCgxrRS6a1ugUjL+KXKK cUcoEUk/QQ8IfwyRV9LJnkUyC454YcxWN6dA1g+ENSAXDAnzWrpA4yNggGe5hu0rIz2y vCrF45/fTqxDa6RtH5Fldd0VRoLPhL6WpgVT+qt0JkUVvsfnjvZMYjcOer971JFil43o kJxkVNUMZI4j6GiBJItGMveULI6EUex7scbD4lWgBSxFQ8iUTApEDFxi+AmYWhu5oz4h BjTA== X-Gm-Message-State: AOAM530OeunFz2+xZRMCVSJmFNlIxGSEo/5tZb+xIg521y7hCJJnbCOA tIeVQDLYIPMBzePy8djIs9o= X-Google-Smtp-Source: ABdhPJxkOkJ+EwNcb0UEZbItCQ7f2qkd86LTQFehnftinWZeRFfscxgzmukLpJfeR38umvHVv7/+3A== X-Received: by 2002:a1c:7501:: with SMTP id o1mr3942531wmc.105.1614177840853; Wed, 24 Feb 2021 06:44:00 -0800 (PST) Received: from localhost.localdomain ([170.253.51.130]) by smtp.googlemail.com with ESMTPSA id a5sm3990676wrs.35.2021.02.24.06.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Feb 2021 06:44:00 -0800 (PST) To: mtk.manpages@gmail.com Subject: [PATCH 07/20] ctime.3: SYNOPSIS: Use 'restrict' in prototypes Date: Wed, 24 Feb 2021 15:42:58 +0100 Message-Id: <20210224144310.140649-8-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1.721.g45526154a5 In-Reply-To: <20210224144310.140649-1-alx.manpages@gmail.com> References: <20210224144310.140649-1-alx.manpages@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 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, Ulrich Drepper Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" POSIX does NOT specify ctime_r() to use 'restrict'. However, glibc uses 'restrict'. Users might be surprised by this! Let's use it here too! ...... .../glibc$ grep_glibc_prototype ctime_r timezone/private.h:504: char *ctime_r(time_t const *, char *); timezone/private.h:712: char *ctime_r(time_t const *, char *); time/time.h:153: extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; .../glibc$ Cc: Cc: Ulrich Drepper Signed-off-by: Alejandro Colomar --- man3/ctime.3 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/man3/ctime.3 b/man3/ctime.3 index cd0ccc98d..7e4baa390 100644 --- a/man3/ctime.3 +++ b/man3/ctime.3 @@ -44,7 +44,7 @@ localtime_r \- transform date and time to broken-down time or ASCII .BI "char *asctime_r(const struct tm *restrict " tm ", char *restrict " buf ); .PP .BI "char *ctime(const time_t *" timep ); -.BI "char *ctime_r(const time_t *" timep ", char *" buf ); +.BI "char *ctime_r(const time_t *restrict " timep ", char *restrict " buf ); .PP .BI "struct tm *gmtime(const time_t *" timep ); .BI "struct tm *gmtime_r(const time_t *restrict " timep , @@ -381,6 +381,12 @@ as obsolete, recommending the use of .BR strftime (3) instead. +.PP +POSIX doesn't specify the parameters of +.BR ctime_r () +to be +.IR restrict ; +that is specific to glibc. .SH NOTES The four functions .BR asctime (),