Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conversion warning on chrono.h #4170

Merged
merged 2 commits into from
Sep 20, 2024
Merged

Fix conversion warning on chrono.h #4170

merged 2 commits into from
Sep 20, 2024

Conversation

Ottani
Copy link
Contributor

@Ottani Ottani commented Sep 20, 2024

Casting from 'long long int' into 'long int' to remove the warning from -Wconversion as the method write_utc_offset accepts a long, and the offset should be in the range of a long variable.

warning: conversion from 'time_t' {aka 'long long int'} to 'long int' may change value [-Wconversion]
Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. I think the correct fix is to change write_utc_offset so that it takes long long.

@Ottani
Copy link
Contributor Author

Ottani commented Sep 20, 2024

Ok, I did the changes as requested and removed the cast from format_utc_offset_impl, storing the value in a long long.

@vitaut vitaut merged commit fe79932 into fmtlib:master Sep 20, 2024
45 checks passed
@vitaut
Copy link
Contributor

vitaut commented Sep 20, 2024

Thanks!

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.

2 participants