Skip to content

Fix conversion warning on chrono.h - #4170

Merged
vitaut merged 2 commits into
fmtlib:masterfrom
Ottani:master
Sep 20, 2024
Merged

Fix conversion warning on chrono.h#4170
vitaut merged 2 commits into
fmtlib:masterfrom
Ottani:master

Conversation

@Ottani

@Ottani Ottani commented Sep 20, 2024

Copy link
Copy Markdown
Contributor

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]

@vitaut vitaut left a comment

Copy link
Copy Markdown
Contributor

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

Ottani commented Sep 20, 2024

Copy link
Copy Markdown
Contributor Author

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
@vitaut

vitaut commented Sep 20, 2024

Copy link
Copy Markdown
Contributor

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