cn-cbor icon indicating copy to clipboard operation
cn-cbor copied to clipboard

cn-encoder: Fix -Wdouble-promotion by explicit cast

Open jnohlgard opened this issue 6 years ago • 0 comments

The intention of this line of code is to check whether the conversion to float reduced the precision of the value, hence the conversion to double is correct here, but when compiled with GCC's -Wdouble-promotion, this implicit cast to double will trigger a warning. The fix for the warning is to make the cast explicit.

jnohlgard avatar Sep 28 '18 07:09 jnohlgard