linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever III <chuck.lever@oracle.com>
To: Salvatore Bonaccorso <carnil@debian.org>,
	Steve Dickson <steved@redhat.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	"1067829@bugs.debian.org" <1067829@bugs.debian.org>,
	"1067829-submitter@bugs.debian.org"
	<1067829-submitter@bugs.debian.org>,
	Vladimir Petko <vladimir.petko@canonical.com>
Subject: Re: Fails to build on arm{el,hf} with 64bit time_t: export-cache.c:110:51: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
Date: Sat, 6 Apr 2024 19:28:58 +0000	[thread overview]
Message-ID: <A3AAF9FA-95BE-461C-8E7A-C0ED02526519@oracle.com> (raw)
In-Reply-To: <ZhGfUpXclZeoZ_az@eldamar.lan>



> On Apr 6, 2024, at 3:15 PM, Salvatore Bonaccorso <carnil@debian.org> wrote:
> 
> Hi Chuck, hi Steve,
> 
> In Debian, as you might have heard there is a 64bit time_t
> transition[1] ongoing affecting the armel and armhf architectures.
> While doing so, nfs-utils was found to fail to build for those
> architectures after the switch, reported in Debian as [2]. Vladimir
> Petko from Ubuntu has as well filled it in [3].
> 
> [1]: https://lists.debian.org/debian-devel-announce/2024/02/msg00005.html
> [2]: https://bugs.debian.org/1067829
> [3]: https://bugzilla.kernel.org/show_bug.cgi?id=218540
> 
> The report is full-quoted below. 
> 
> Vladimir Petko has created a patch in the bugzilla which I'm attaching
> here as well. If this is not an acceptable format due to missing
> Signed-off's I'm attaching a variant with a Suggested-by for Vladimir
> to properly credit the patch origin.
> 
> Let me know if that works. I changed it slightly and only casting to
> long long, and made it almost checkpatch clean.

I suppose strftime(3) might be nicer, but this works.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com <mailto:chuck.lever@oracle.com>>


> Regards,
> Salvatore
> 
> ----- Forwarded message from Sebastian Ramacher <sramacher@debian.org> -----
> 
> From: Sebastian Ramacher <sramacher@debian.org>
> Resent-From: Sebastian Ramacher <sramacher@debian.org>
> Reply-To: Sebastian Ramacher <sramacher@debian.org>, 1067829@bugs.debian.org
> Date: Wed, 27 Mar 2024 11:02:25 +0100
> To: Debian Bug Tracking System <submit@bugs.debian.org>
> Subject: Bug#1067829: nfs-utils: FTBFS on arm{el,hf}: export-cache.c:110:51: error: format ‘%ld’ expects argument of
> type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
> Delivered-To: submit@bugs.debian.org
> Message-ID: <ZgPusfnkCCvhalve@ramacher.at>
> 
> Source: nfs-utils
> Version: 1:2.6.4-3
> Severity: serious
> Tags: ftbfs
> Justification: fails to build from source (but built successfully in the past)
> X-Debbugs-Cc: sramacher@debian.org
> 
> https://buildd.debian.org/status/fetch.php?pkg=nfs-utils&arch=armel&ver=1%3A2.6.4-3%2Bb2&stamp=1711452552&raw=0
> 
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../support/include -I/usr/include/tirpc -I/usr/include/libxml2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -pipe -Wall -Wextra -Werror=strict-prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=format=2 -Werror=undef -Werror=missing-include-dirs -Werror=strict-aliasing=2 -Werror=init-self -Werror=implicit-function-declaration -Werror=return-type -Werror=switch -Werror=overflow -Werror=parentheses -Werror=aggregate-return -Werror=unused-result -fno-strict-aliasing -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -Wno-cast-function-type -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -c xml.c  -fPIC -DPIC -o .libs/xml.o
> export-cache.c: In function ‘junction_flush_exports_cache’:
> export-cache.c:110:51: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=]
>  110 |         snprintf(flushtime, sizeof(flushtime), "%ld\n", now);
>      |                                                 ~~^     ~~~
>      |                                                   |     |
>      |                                                   |     time_t {aka long long int}
>      |                                                   long int
>      |                                                 %lld
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../support/include -I/usr/include/tirpc -I/usr/include/libxml2 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -pipe -Wall -Wextra -Werror=strict-prototypes -Werror=missing-prototypes -Werror=missing-declarations -Werror=format=2 -Werror=undef -Werror=missing-include-dirs -Werror=strict-aliasing=2 -Werror=init-self -Werror=implicit-function-declaration -Werror=return-type -Werror=switch -Werror=overflow -Werror=parentheses -Werror=aggregate-return -Werror=unused-result -fno-strict-aliasing -Werror=format-overflow=2 -Werror=int-conversion -Werror=incompatible-pointer-types -Werror=misleading-indentation -Wno-cast-function-type -g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -c display.c -o display.o >/dev/null 2>&1
> cc1: some warnings being treated as errors
> make[3]: *** [Makefile:489: export-cache.lo] Error 1
> make[3]: *** Waiting for unfinished jobs....
> 
> Cheers
> -- 
> Sebastian Ramacher
> 
> ----- End forwarded message -----
> <armhf-time-t-format-error.patch><0001-junction-export-cache-cast-to-a-type-with-a-known-si.patch>

--
Chuck Lever



  reply	other threads:[~2024-04-06 19:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06 19:15 Fails to build on arm{el,hf} with 64bit time_t: export-cache.c:110:51: error: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘time_t’ {aka ‘long long int’} [-Werror=format=] Salvatore Bonaccorso
2024-04-06 19:28 ` Chuck Lever III [this message]
2024-05-02  5:00   ` Salvatore Bonaccorso
2024-05-02 12:57     ` Chuck Lever
2024-05-02 13:55       ` Salvatore Bonaccorso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A3AAF9FA-95BE-461C-8E7A-C0ED02526519@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=1067829-submitter@bugs.debian.org \
    --cc=1067829@bugs.debian.org \
    --cc=carnil@debian.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    --cc=vladimir.petko@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).