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: AS22989 208.118.235.0/24 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 9D8611F405 for ; Sat, 29 Dec 2018 17:40:52 +0000 (UTC) Received: from localhost ([127.0.0.1]:40875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdIbT-00047p-Rc for normalperson@yhbt.net; Sat, 29 Dec 2018 12:40:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:36940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdIZG-0000fP-Rj for bug-gnulib@gnu.org; Sat, 29 Dec 2018 12:38:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdIJi-0007pv-R4 for bug-gnulib@gnu.org; Sat, 29 Dec 2018 12:22:35 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35984) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gdIJi-0007h3-Km for bug-gnulib@gnu.org; Sat, 29 Dec 2018 12:22:30 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 14093160E35; Sat, 29 Dec 2018 09:22:19 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id AKvmEPmHWTMd; Sat, 29 Dec 2018 09:22:18 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EBDC4160E36; Sat, 29 Dec 2018 09:22:17 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JL5aMobVwA0B; Sat, 29 Dec 2018 09:22:17 -0800 (PST) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id BAB26160E21; Sat, 29 Dec 2018 09:22:17 -0800 (PST) Subject: Re: new module suggestion: fprintftime-check To: Assaf Gordon , Bruno Haible , bug-gnulib@gnu.org References: <5c116236-dfd7-9bd9-a18e-3e55789ae985@gmail.com> <42958301.nlEivnNqOc@omega> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sat, 29 Dec 2018 09:22:17 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: "bug-gnulib" > I suspect that changing this behavior would be a disruptive > backwards-incompatible change (but other opinions are welcomed). I wouldn't mind a change as long as it changes the API enough so that com= pilers=20 complain if we don't also update the calling code. For example, nstrftime= could=20 take an additional ptrdiff_t * argument that (if not null) is set to the = offset=20 of the first offending % or encoding error, or to -1 if the format is OK.= (We=20 should report encoding errors as well as bad % formats.) (Using ptrdiff_t is part of my campaign to prefer ptrdiff_t to size_t. Wh= ile=20 we're at it, let's change the other size_t args to ptrdiff_t, but I digre= ss....) > nstrtime's __strftime_internal() is a complicated beast, I don't > claim to fully understand it. > But the function contains this comment: > =C2=A0=C2=A0 /* POSIX.1 requires that local time zone information be u= sed as > =C2=A0=C2=A0=C2=A0=C2=A0 though strftime called tzset.=C2=A0 */ > https://git.savannah.gnu.org/cgit/gnulib.git/tree/lib/nstrftime.c#n540 This comment is for the POSIX API where there was no timezone_t argument.= It=20 doesn't apply to the Gnulib API, because of the "undef HAVE_TZSET" earlie= r on.=20 The only reason for the tzset_called stuff is the faint hope that we can = merge=20 all this stuff into glibc someday.