Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid clang 10 -Wimplicit-int-float-conversion warning/error when con… #2943

Merged
merged 1 commit into from
May 29, 2022

Commits on Feb 26, 2020

  1. Avoid clang 10 -Wimplicit-int-float-conversion warning/error when con…

    …verting int into float
    
    Example of warning (error when using -Werror) we get with clang 10:
    
    /remote/intdeliv/components/osp/Poco/Foundation/19-0-0-6/include/Poco/Dynamic/VarHolder.h:444:14: error: implicit conversion from 'int' to 'float' changes value from 2147483647 to 2147483648 [-Werror,-Wimplicit-int-float-conversion]
                    if (from > std::numeric_limits<T>::max())
                             ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /remote/intdeliv/components/osp/Poco/Foundation/19-0-0-6/include/Poco/Dynamic/VarHolder.h:332:4: note: in instantiation of function template specialization 'Poco::Dynamic::VarHolder::checkUpperLimitFloat<float, int>' requested here
                            checkUpperLimitFloat<F,T>(from);
                            ^
    /remote/intdeliv/components/osp/Poco/Foundation/19-0-0-6/include/Poco/Dynamic/VarHolder.h:2175:3: note: in instantiation of function template specialization 'Poco::Dynamic::VarHolder::convertToSmaller<float, int>' requested here
                    convertToSmaller(_val, val);
                    ^
    Romain-Geissler-1A committed Feb 26, 2020
    Configuration menu
    Copy the full SHA
    1b0c07f View commit details
    Browse the repository at this point in the history