Skip to content

Conversation

@amousset
Copy link
Contributor

@amousset amousset commented Feb 11, 2026

Use %jd + intmax_t to format the timestamp (like other time_t formats do) in file backup code.

On ARMv7 (which is, understandably, unsupported) it segfaults at runtime. But formatting a (signed) time_t as unsigned is, AFAIK, undefined behavior annyway.

Use %jd to get the timestamp like other functions do.
Copy link
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable. Thanks for the contribution. Hope your ARMv7 systems are doing well.

@amousset amousset marked this pull request as draft February 11, 2026 19:47
@amousset
Copy link
Contributor Author

amousset commented Feb 11, 2026

Fixed other similar warnings (although less serious) with the same change for consistency.

locks.c:356:79: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'time_t' {aka 'long long int'} [-Wformat=]
  356 |         Log(LOG_LEVEL_DEBUG, "Giving time to process '%d' (holding lock for %ld s)", entry->pid, (now - entry->time));
      |                                                                             ~~^                  ~~~~~~~~~~~~~~~~~~~
      |                                                                               |                       |
      |                                                                               long int                time_t {aka long long int}
      |                                                                             %lld

@amousset amousset marked this pull request as ready for review February 11, 2026 19:57
@larsewi
Copy link
Contributor

larsewi commented Feb 11, 2026

@cf-bottom Jenkins please :)

@cf-bottom
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants