[ros-dev] [ros-diffs] [jgardou] 54462: [RTL] - explicitly truncate some values, so it doesn't count as an error for compiler/MSVC runtime checker

Timo Kreuzer timo.kreuzer at web.de
Thu Nov 24 09:33:46 UTC 2011


Am 24.11.2011 00:27, schrieb Jérôme Gardou:
> Truncating it explicitly tells it "yes, I truncate this value, not for 
> avoiding compiler warning, but because that's what I want". See r54460 
> to see which kind of bugs such checkers could help to fix.
>
What's next?
(Value & 0xFFFF) -> warning because ANDing an ULONG64 is regarded as 
"silencing a warning" -> fix: 
__really_truncate_this_unsigned_int64_to_ushort_and_discard_lost_bits(Value); 
?

For me casting *is* already doing it "explicitly". And if someone 
doesn't know that casting is the same as truncating, he shouldn't do C 
coding.

I agree with Aleksey: turn this feature off, its a bit too much.

Timo




More information about the Ros-dev mailing list