Skip to content

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

Closed
Romain-Geissler-1A wants to merge 1 commit intopocoproject:masterfrom
Romain-Geissler-1A:master
Closed

Avoid clang 10 -Wimplicit-int-float-conversion warning/error when con…#2942
Romain-Geissler-1A wants to merge 1 commit intopocoproject:masterfrom
Romain-Geissler-1A:master

Conversation

@Romain-Geissler-1A
Copy link
Copy Markdown
Contributor

…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::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);
^

…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);
                ^
@obiltschnig obiltschnig added this to the Release 1.10.2 milestone Feb 26, 2020
@obiltschnig obiltschnig self-assigned this Feb 26, 2020
@obiltschnig
Copy link
Copy Markdown
Member

Thanks, but could you please re-target the PR against devel branch?

@Romain-Geissler-1A
Copy link
Copy Markdown
Contributor Author

I opened #2943 targeting devel branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants