ETLCPP / etl

Embedded Template Library
https://www.etlcpp.com
MIT License
2.05k stars 373 forks source link

endian enum_type produces useless-cast warnings #780

Closed digimokan closed 7 months ago

digimokan commented 8 months ago

In endianness.h, the int static_casts to the ETL_ENDIAN_LITTLE/BIG/NATIVE values in enum enum_type (inside struct endian) are producing warnings when compiled with -Wuseless-castin gcc.

It looks like the warnings go away when the casts are changed to functional casts (e.g. int{ETL_ENDIAN_LITTLE}), but that only works with C++11. I can't tell, but it looks like the literal values would be of type int anyway?

jwellbelove commented 7 months ago

Fixed 20.38.7