Skip to content

Commit

Permalink
Fix -Wconversion warning (fmtlib#2724)
Browse files Browse the repository at this point in the history
* - try fixing the warning "chrono.h:1217:37: warning: conversion from 'std::make_unsigned<long long int>::type' {aka 'long long unsigned int'} to 'size_t' {aka 'unsigned int'} may change value [-Wconversion]" by casting int to size_t (occurs when cross-compiling to Raspberry Pi ARMv7)

* - remove call to to_unsigned() because using static_cast<size_t> is enough
  • Loading branch information
Tobi823 authored Jan 19, 2022
1 parent 5985f0a commit b8b037e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ template <typename OutputIt, typename Char> class tm_writer {
char buf[10];
size_t offset = 0;
if (year >= 0 && year < 10000) {
copy2(buf, digits2(to_unsigned(year / 100)));
copy2(buf, digits2(static_cast<size_t>(year / 100)));
} else {
offset = 4;
write_year_extended(year);
Expand Down

0 comments on commit b8b037e

Please sign in to comment.