There is a lot of errors/warnings like that across the library with different types of conversions (in total more than 100):
error: conversion to ‘float’ from ‘double’ may alter its value [-Werror=float-conversion]
error: conversion to ‘unsigned char’ from ‘uint32_t {aka unsigned int}’ may alter its value [-Werror=conversion]
error: conversion from ‘int’ to ‘uint8_t’ {aka ‘unsigned char’} may change value [-Werror=conversion]
Of course one can turn off Werror or Wconversion flags and then all this errors will disappear, but what if project requires compilation with this flags and how to find such types of errors in users code if these flags are turned off.
Maybe it is makes sense to precisely cast types to appropriate where it can cause compiler problem? E.g.
uint8_t Y = (uint8_t)(X); (in C)
uint8_t Y = static_cast<uint8_t>(X); (in C++)