boostorg / date_time

Boost.org date_time module
http://boost.org/libs/date_time
Boost Software License 1.0
67 stars 95 forks source link

Cast month numbers to the correct type in date parsing map init #152

Closed Lastique closed 4 years ago

Lastique commented 4 years ago

Since the map contains unsigned short for month numbers, it is more correct to explicitly cast constants to that type rather than short.

codecov[bot] commented 4 years ago

Codecov Report

Merging #152 into develop will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #152   +/-   ##
========================================
  Coverage    52.72%   52.72%           
========================================
  Files           76       76           
  Lines         4491     4491           
  Branches      2243     2243           
========================================
  Hits          2368     2368           
  Misses         391      391           
  Partials      1732     1732           
Impacted Files Coverage Δ
include/boost/date_time/date_parsing.hpp 33.01% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d0b3c1d...9e181d5. Read the comment docs.

mclow commented 4 years ago

That's amazingly ugly. This is because of https://stackoverflow.com/questions/61552098/boost-1-73-log-library-regression, isn't it?

I stand by my comment that this is the compiler being silly.

Lastique commented 4 years ago

I totally agree that the compiler should not emit that warning. However, if we do the cast, we should cast to the right type.

mclow commented 4 years ago

I concur 100%. IMHO, we should remove the casts and suppress the warning.

JeffGarland commented 4 years ago

although I agree the compiler is silly it's not worth more intellectual effort at this point so just merging it.

mclow commented 4 years ago

I've spoken to a MS compiler dev, and he's opened a bug against MSVC for this behavior.

JeffGarland commented 4 years ago

wow nice! anyway we can get notified when it is fixed?