[Buildroot] [PATCH 1/1] package/libpam-tacplus: fix build when time_t is 64 bits

Fabrice Fontaine fontaine.fabrice at gmail.com
Sun May 17 19:57:33 UTC 2020


Le dim. 17 mai 2020 à 21:27, Thomas Petazzoni
<thomas.petazzoni at bootlin.com> a écrit :
>
> On Sun, 17 May 2020 19:05:07 +0200
> Fabrice Fontaine <fontaine.fabrice at gmail.com> wrote:
>
> > +Fixes:
> > + - http://autobuild.buildroot.org/results/874433d8cb30d21332f23024081a8b6d7b3254ae
> > +
> > +Signed-off-by: Fabrice Fontaine <fontaine.fabrice at gmail.com>
> > +[Retrieved from:
> > +https://github.com/kravietz/pam_tacplus/commit/f3913777ea8373c58981061a01a7eda187ffc9d9]
> > +---
> > + tacc.c | 4 ++--
> > + 1 file changed, 2 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/tacc.c b/tacc.c
> > +index ef9d081..9260373 100644
> > +--- a/tacc.c
> > ++++ b/tacc.c
> > +@@ -343,7 +343,7 @@ int main(int argc, char **argv) {
> > +         /* start accounting */
> > +         struct tac_attrib *attr = NULL;
> > +
> > +-        sprintf(buf, "%lu", time(0));
> > ++        sprintf(buf, "%llu", time(0));
>
> But isn't this going to introduce another warning when time_t is 32-bit ?
Yes, indeed, thanks for spotting my mistake. What would be a proper fix?
Disable -Werror? Cast time_t into (unsigned long) as already done by
upstream in pam_tacplus.c?
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Best Regards,

Fabrice


More information about the buildroot mailing list