#2757 closed Patches (fixed)
Warning C4244: conversion from 'int' to 'unsigned short' in microsec_time_clock.hpp line 103
Reported by: | Owned by: | az_sw_dude | |
---|---|---|---|
Milestone: | Boost 1.43.0 | Component: | date_time |
Version: | Boost Development Trunk | Severity: | Cosmetic |
Keywords: | Cc: |
Description
With Visual Studio 2005, the compiler raises the following warning:
c:\programme\boost\boost_1_38_0\boost\date_time\microsec_time_clock.hpp(103) : warning C4244: 'argument' : conversion from 'int' to 'unsigned short', possible loss of data
The members of the std::tm struct are ints, but the greg_year type is declared as unsigned short in greg_year.hpp.
Change History (9)
comment:1 by , 14 years ago
comment:2 by , 13 years ago
Type: | Bugs → Patches |
---|
FWIW, this problem still applies to current release (1.41.0) and trunk. The file <boost/date_time/microsec_time_clock.hpp> ends up included in a lot of situations, e.g. via Boost.Thread, so I see this warning many many many times in my code base.
I independently reinvented the same patch as the OP. Unfortunately I didn't think to check Trac until I had one - any chance of this being applied so nobody else has to..?
comment:3 by , 13 years ago
Milestone: | Boost 1.39.0 → Boost 1.43.0 |
---|---|
Version: | Boost 1.38.0 → Boost Development Trunk |
Please fix this... The warnings are annoying.
comment:4 by , 13 years ago
comment:5 by , 13 years ago
Thank you Andrey!
I assume this will have to wait for merge until 1.44.0?
comment:7 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 9 comment:8 by , 10 years ago
Seeing this warning with Boost 1.49, MSVS 2008. The warnings are not suppressible using MS's #pragma warning
feature.
comment:9 by , 10 years ago
Replying to michael.cowperthwaite@…:
Seeing this warning with Boost 1.49, MSVS 2008. The warnings are not suppressible using MS's
#pragma warning
feature.
Sorry, I was wrong; warning at different location. See new ticket #6936.
Line 99ff:
This will suppress this warning.