From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 8B8761F454 for ; Mon, 11 Nov 2019 09:55:54 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=elOc3a2gMIWQo1AB06bDQIUpj8PC0HpRNV9Dih+otKx vYmsKw9NoUTLTYI3mj5zncx5zL2GuDUskhkoruQgjIUFJSQ8grW+feGQcWBP+0+m 6FedxdONW/IJiy42edCUN3m61bFf9LJAacGP1Az2Bkma6pNBztsPux36Rg5wAFAM = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; s=default; bh=D724VTnkv4CTw5XHl/OHsp+wdXc=; b=nPz5FeSuyJfCPk82u JXzoq1vHWbRgXlNlaYOpZND6AJS1QlgEQecVnkNHp2mp4qVYCHlUZaxOwX9guwG6 bJZxGXrB2LGQKKBCmDUYdWcrAvrdmIBSZj8gt8svFz/tww3C6kLTbJ02Mf1+C5GU M0oaM/Duz8j3jBafdPr5FCWBfQ= Received: (qmail 101033 invoked by alias); 11 Nov 2019 09:55:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 101023 invoked by uid 89); 11 Nov 2019 09:55:52 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1573466149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=77wBcCJDc0Avy2Vst7MjVgY4/6K1LxYvb9qmGxZB/oE=; b=CCrNIM30Ua0NNWckxAjJ/wX+1TXEItaD91n4d4SocWC9RbhjypCQdZ527yWmB0yV3p8ySY +albVjebdRNIu14pRJOi4lq93i9wyfCChspJ8ub7wX3IHld6NnWhaCrwESY7KU/tMKGjnR JOjzve9Shxkk8Y0QTD6LcdQ1UUeQHHw= From: Florian Weimer To: Joseph Myers Cc: Subject: Re: Declare asctime_r, ctime_r, gmtime_r, localtime_r for C2X References: Date: Mon, 11 Nov 2019 10:55:43 +0100 In-Reply-To: (Joseph Myers's message of "Fri, 8 Nov 2019 20:49:28 +0000") Message-ID: <87sgmuybxc.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable * Joseph Myers: > C2X adds the asctime_r, ctime_r, gmtime_r and localtime_r functions. > This patch duly adds __GLIBC_USE (ISOC2X) to the conditions under > which declares them. > > Tested for x86_64. > > diff --git a/time/time.h b/time/time.h > index 7daaacce16..05d9098c13 100644 > --- a/time/time.h > +++ b/time/time.h > @@ -122,7 +122,7 @@ extern struct tm *gmtime (const time_t *__timer) __TH= ROW; > of *TIMER in the local timezone. */ > extern struct tm *localtime (const time_t *__timer) __THROW; > =20 > -#ifdef __USE_POSIX > +#if defined __USE_POSIX || __GLIBC_USE (ISOC2X) > /* Return the `struct tm' representation of *TIMER in UTC, > using *TP to store the result. */ > extern struct tm *gmtime_r (const time_t *__restrict __timer, > @@ -132,7 +132,7 @@ extern struct tm *gmtime_r (const time_t *__restrict = __timer, > using *TP to store the result. */ > extern struct tm *localtime_r (const time_t *__restrict __timer, > =09=09=09 struct tm *__restrict __tp) __THROW; > -#endif=09/* POSIX */ > +#endif=09/* POSIX || C2X */ > =20 > /* Return a string of the form "Day Mon dd hh:mm:ss yyyy\n" > that is the representation of TP in this format. */ > @@ -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; > =20 > -#ifdef __USE_POSIX > +#if defined __USE_POSIX || __GLIBC_USE (ISOC2X) > /* Reentrant versions of the above functions. */ > =20 > /* 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, > =09=09 char *__restrict __buf) __THROW; > -#endif=09/* POSIX */ > +#endif=09/* POSIX || C2X */ > =20 > =20 > /* Defined in localtime.c. */ This patch is okay. Thanks. Note that this is the kind of patch where a patch review tool actually helps because the context in the patch as posted is insufficient for review. Florian