Skip to content

Fix 64 bit time_t warning.#939

Merged
thefallentree merged 1 commit intofluffos:masterfrom
fobser:time_t
Nov 19, 2022
Merged

Fix 64 bit time_t warning.#939
thefallentree merged 1 commit intofluffos:masterfrom
fobser:time_t

Conversation

@fobser
Copy link
Copy Markdown
Contributor

@fobser fobser commented Nov 19, 2022

warning: format specifies type 'ssize_t' (aka 'long') but the argument has type 'time_t' (aka 'long long') [-Wformat]

@fobser
Copy link
Copy Markdown
Contributor Author

fobser commented Nov 19, 2022

This can be an issue on 32 bit systems with 64 bit time_t or on systems where the compiler doesn't understand
that long and long long are both 64 bit.

Casting to a (guaranteed) at least 64 bit type and printing that works around this.

warning: format specifies type 'ssize_t' (aka 'long') but the argument
has type 'time_t' (aka 'long long') [-Wformat]
@thefallentree
Copy link
Copy Markdown
Member

Casting to uint64_t would be better, but not that important

@thefallentree thefallentree merged commit 72f1cdf into fluffos:master Nov 19, 2022
Amirani-al pushed a commit to Amirani-al/fluffos that referenced this pull request May 30, 2023
warning: format specifies type 'ssize_t' (aka 'long') but the argument
has type 'time_t' (aka 'long long') [-Wformat]
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.

2 participants