From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x935.google.com (mail-ua1-x935.google.com [IPv6:2607:f8b0:4864:20::935]) by sourceware.org (Postfix) with ESMTPS id 0879A3858D35 for ; Thu, 25 Nov 2021 18:51:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0879A3858D35 Received: by mail-ua1-x935.google.com with SMTP id p37so14122556uae.8 for ; Thu, 25 Nov 2021 10:51:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QQEhrkeis5vMOHl7L77kG/vtbaUijYVwDdW6uxiXNSA=; b=PuWn995EjEhrr2EfoJTVWLwIzqdXv5nO7N75VVaejqKXAQDb7024tn9GAFFwBiOGuE pvzm3+I7gpM4dsKl3LI9bogRPPMtqfr219fIW0OG8mAMgKDywnCaN10YueKj/WGcsO6E MVwjnmUfYvuO/e28KpR5rB05O56xfCU8m6dZQpUj3Ow/MxeyGXDjoBCzCoLrGFezucmr x9xJezlC7V7SnF/yLMw0KaXU2jvnZsH0WKtg/PksV8ayUJ6qNOT3OXVFMafaaCE0S+3i YSHuakqC8lZ9zRmhY8bnhp1uQWts95nzbU8XOBNwzoZoLJRbJzEQ8vKMPNy5wS3+ixCb f0VA== X-Gm-Message-State: AOAM532lL0YsSNDF6A/aXcfTS5OE9VtFqfwMKghSrr4Nwutv8gqE0Jtu WF8FODNahkzbqHLU5g8G3zziwkaM1+bk3GRuI+Y= X-Google-Smtp-Source: ABdhPJzH6dWJWPWjBtQwm3LT5da/sUBlLMBPV1JRqRk7CBSptWzub4XepQHcAFMPuPL4ZcGARN6ZgdbXz7qipY8qvVU= X-Received: by 2002:a05:6102:3232:: with SMTP id x18mr12771752vsf.38.1637866268619; Thu, 25 Nov 2021 10:51:08 -0800 (PST) MIME-Version: 1.0 References: <20211121221411.404194-1-alex@linutronix.de> <20211125175107.GA25053@redhat.com> In-Reply-To: <20211125175107.GA25053@redhat.com> From: Alexander Kanavin Date: Thu, 25 Nov 2021 19:50:57 +0100 Message-ID: Subject: Re: [PATCH] debuginfod/debuginfod-client.c: correct string format on 32bit arches with 64bit time_t To: fche@redhat.com Cc: Mark Wielaard , elfutils-devel@sourceware.org, Khem Raj X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Nov 2021 18:51:10 -0000 According to 'man 3 printf' %j appeared in glibc 2.1 and seems to be C99 feature. That's decidedly ancient. And may I be allowed to suggest, unless elfutils is tested in upstream CI with decade-old toolchains, you should not be considering its compatibility with them. Alex On Thu, 25 Nov 2021 at 18:51, Frank Ch. Eigler wrote: > Hi - > > > Use intmax_t to print time_t > > [...] > > - if (dprintf(fd, "%ld", cache_config_default_s) < 0) > > + if (dprintf(fd, "%jd", (intmax_t)cache_config_default_s) < 0) > > [...] > > I'm not a compatibility specialist, but note that elfutils is sometimes > built on decade-old toolchains, where use of %lld and (long long) would > certainly work. We have such in the code base already, whereas this would > be the first %j. > > - FChE > >