diff --git a/include/etl/smallest.h b/include/etl/smallest.h index 87a59af0..92f34a80 100644 --- a/include/etl/smallest.h +++ b/include/etl/smallest.h @@ -342,9 +342,9 @@ namespace etl private: // Determines the index of the best signed type for the required value. - static const int TYPE_INDEX = (((VALUE > INT_LEAST8_MAX) || (VALUE < INT_LEAST8_MIN)) ? 1 : 0) + - (((VALUE > INT16_MAX) || (VALUE < INT16_MIN)) ? 1 : 0) + - (((VALUE > INT32_MAX) || (VALUE < INT32_MIN)) ? 1 : 0); + static const int TYPE_INDEX = (((VALUE > intmax_t(INT_LEAST8_MAX)) || (VALUE < intmax_t(INT_LEAST8_MIN))) ? 1 : 0) + + (((VALUE > intmax_t(INT16_MAX)) || (VALUE < intmax_t(INT16_MIN))) ? 1 : 0) + + (((VALUE > intmax_t(INT32_MAX)) || (VALUE < intmax_t(INT32_MIN))) ? 1 : 0); public: