From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailbackend.panix.com (mailbackend.panix.com [166.84.1.89]) by sourceware.org (Postfix) with ESMTPS id AA80D3850432 for ; Wed, 28 Oct 2020 14:13:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AA80D3850432 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=panix.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=zackw@panix.com Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) by mailbackend.panix.com (Postfix) with ESMTPSA id 4CLrBj1K3RzxlL for ; Wed, 28 Oct 2020 10:13:00 -0400 (EDT) Received: by mail-ej1-f42.google.com with SMTP id k3so7383087ejj.10 for ; Wed, 28 Oct 2020 07:13:00 -0700 (PDT) X-Gm-Message-State: AOAM531qSXORNFrr9TtP/nqyPN+UjdsN74JnwcWfmYEQoL7ph/n76YJJ yqRqbYMjKmIsr+w7iLJDgjqruMSr0GWFVgMryDk= X-Google-Smtp-Source: ABdhPJwIBVGbTMN6w2Tibn0O5ctAwQ9LQTk8ToUcA5uQCIcg9bs32nOHzqtVePO0aZaT54AeYcYRK/Q2SNJD/ly2JhQ= X-Received: by 2002:a17:906:e24a:: with SMTP id gq10mr7563351ejb.552.1603894379780; Wed, 28 Oct 2020 07:12:59 -0700 (PDT) MIME-Version: 1.0 References: <87sga7x2i5.fsf@oldenburg2.str.redhat.com> <20201021123559.598864-1-adhemerval.zanella@linaro.org> <878sbtarjn.fsf@oldenburg2.str.redhat.com> <87zh499cij.fsf@oldenburg2.str.redhat.com> <2e55385f-b3f2-9326-8504-28205b97a7d2@linaro.org> <87a6w6wj54.fsf@oldenburg2.str.redhat.com> In-Reply-To: <87a6w6wj54.fsf@oldenburg2.str.redhat.com> From: Zack Weinberg Date: Wed, 28 Oct 2020 10:12:47 -0400 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] Reinstate ftime and move define it for POSIX.1-2001 or older To: Florian Weimer Cc: Adhemerval Zanella , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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-List-Received-Date: Wed, 28 Oct 2020 14:13:06 -0000 On Wed, Oct 28, 2020 at 9:54 AM Florian Weimer via Libc-alpha wrote: > > * Adhemerval Zanella: > > > On 26/10/2020 13:29, Florian Weimer wrote: > >> * Adhemerval Zanella: > >> > >>> On 26/10/2020 13:19, Florian Weimer wrote: > >>>> * Adhemerval Zanella: > >>>> > >>>>> +struct timeb > >>>>> + { > >>>>> + time_t time; /* Seconds since epoch, as from `time'. */ > >>>>> + unsigned short int millitm; /* Additional milliseconds. */ > >>>>> + short int timezone; /* Minutes west of GMT. */ > >>>>> + short int dstflag; /* Nonzero if Daylight Savings Time used. */ > >>>>> + }; > >>>> > >>>> I think you could add __attribute_deprecated_msg__ on the struct itself. > >>> > >>> I tried to add on it, but it would require to add the warning suppression > >>> on ftime.c build before the header inclusion and also on check-local header > >>> tests as well (since it includes). > >> > >> Ahh, so you get a deprecation warning on the ftime function declaration, > >> even though itself it is marked deprecated. Oh well. That's not how > >> things work in Java. > > > > On the struct timeb declaration to be more exact, even when then ftime > > is not issued. I would expect a deprecation warning iff the code > > actually uses the struct timeb. > > The ftime prototype uses it (in the deprecation sense). This use should > be ignored due to the deprecation attribute on ftime itself, though. Workaround: move the complete declaration of struct timeb, with __attribute_deprecated__, below the declaration of ftime: __BEGIN_DECLS /* Forward-declare struct timeb so we can use it in the prototype of ftime without a spurious deprecation warning. See GCC bug xxxxxx. */ struct timeb; /* Fill in TIMEBUF with information about the current time. */ extern int ftime (struct timeb *__timebuf) __nonnull ((1)) __attribute_deprecated__; /* Structure returned by the `ftime' function. */ struct timeb { time_t time; /* Seconds since epoch, as from `time'. */ unsigned short int millitm; /* Additional milliseconds. */ short int timezone; /* Minutes west of GMT. */ short int dstflag; /* Nonzero if Daylight Savings Time used. */ } __attribute_deprecated__; __END_DECLS zw