Skip to content

Fix time arithmetic on 32-bit systems - #316

Open
pghmcfc wants to merge 1 commit into
dovecot:mainfrom
pghmcfc:i686
Open

Fix time arithmetic on 32-bit systems#316
pghmcfc wants to merge 1 commit into
dovecot:mainfrom
pghmcfc:i686

Conversation

@pghmcfc

@pghmcfc pghmcfc commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactor or code cleanup

Description

Commit 7cedd93 required that time_t be signed, and commit 00a26d6 dropped the TIME_T_SIGNED define.

However, m4/gmtime_max.m4 still used TIME_T_SIGNED, and without that we get TIME_T_MAX_BITS of 32 on 32-bit systems rather than 31. This breaks an assumption in time_max_safe_value() in src/lib/time-util.c, which results in the time_add_secs() and time_sub_secs() functions malfunctioning.

Commit 7cedd93 required that time_t be signed, and commit 00a26d6
dropped the define of the TIME_T_SIGNED define.

However, m4/gmtime_max.m4 still used TIME_T_SIGNED, and without that
we get TIME_T_MAX_BITS of 32 on 32-bit systems rather than 31. This
breaks an assumption in time_max_safe_value() in src/lib/time-util.c,
which results in the time_add_secs() and time_sub_secs() functions
malfunctioning.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant