From patchwork Thu May 13 22:39:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 43426 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 A1A54383F40B; Thu, 13 May 2021 22:39:34 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 02483383F409 for ; Thu, 13 May 2021 22:39:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 02483383F409 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: UFpQ6uhM7h+yvDDfMNl2ZSb+/wFtd6HHXDx+huuDsuP8CgmeFDfWzTv52h1t6qvv9O9Q9uoRqk mF6I8s86N4DKUu15kk1+LqUVXK5/4pHZRlKniHz1/YevAUzETYJcpnMKQev02dmydTjyDUQKWO Vu1uRhh2DUzIgqN0TdrnX/M9wfDCV2nMYooB0RRuv3jm5rIxANJQPZP3QTPmyCG1P7nzkuaiBe ufWl/jYUZGYMo57l7DZYyFd601sutzxKhfEAFx6GzM1N6NfRK6AQHLvvQYHmMVxjWETs2e+hmS dkY= X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="61185639" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 13 May 2021 14:39:31 -0800 IronPort-SDR: Gti/2j6m3zFiMwAVP7GrDY3WWUOFXSuUytnPtEmjwZRFsMkP9ypAoBeygvVQYRtvkzDHzKoicT mNYbRyfrcFa1ghMmFMM3mmAtrkRCblywSxmKa8Rl83UpbnWKhQcTDnEaBMWQAltT1AgeCQXRf2 qp9mSCkDTqsQHdOokGbaA9K+5bQoQw4i5H236aYUyrl6SkNEIvUmizH8TaXhcxCYx6HWypbf5O SKKOIJEtGnjNMBIyofxnj9yca50gyG9FgFzhBRxUy2wzicslrTvfjldsq3x8XyZdV9lnqMhj6F gZg= Date: Thu, 13 May 2021 22:39:26 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Subject: Do not declare asctime_r and ctime_r for C2X Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-06.mgc.mentorg.com (139.181.222.6) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3127.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, 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: , Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" ISO C2X added the asctime_r, ctime_r, gmtime_r and localtime_r functions from POSIX. It's now removed asctime_r and ctime_r again, reflecting that they are marked obsolescent in POSIX; update glibc's time.h accordingly. The same change that removed those two functions from C2X also marked asctime and ctime as deprecated (reflecting how POSIX shows them as obsolescent), i.e. using the [[deprecated]] attribute in the prototypes shown in C2X. It's less clear if we should explicitly deprecate those functions like that in the glibc headers; this patch does nothing regarding such a deprecation (there's no normative requirement from C2X showing the functions as deprecated). Tested for x86_64 and x86. Reviewed-by: Adhemerval Zanella diff --git a/time/time.h b/time/time.h index 3bf206be0b..dcc2d595e8 100644 --- a/time/time.h +++ b/time/time.h @@ -141,7 +141,7 @@ extern char *asctime (const struct tm *__tp) __THROW; /* Equivalent to `asctime (localtime (timer))'. */ extern char *ctime (const time_t *__timer) __THROW; -#if defined __USE_POSIX || __GLIBC_USE (ISOC2X) +#ifdef __USE_POSIX /* Reentrant versions of the above functions. */ /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n" @@ -152,7 +152,7 @@ extern char *asctime_r (const struct tm *__restrict __tp, /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'. */ extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) __THROW; -#endif /* POSIX || C2X */ +#endif /* POSIX */ /* Defined in localtime.c. */