Skip to content

Conversation

matejk
Copy link
Contributor

@matejk matejk commented Mar 11, 2025

Fixes #4886, replaces #4887.

@matejk matejk added this to the Release 1.14.2 milestone Mar 11, 2025
@matejk matejk added this to 1.14 Mar 11, 2025
@matejk matejk self-assigned this Mar 11, 2025
@matejk matejk moved this to In Progress in 1.14 Mar 11, 2025
@matejk matejk force-pushed the 4886-fix-dynamic-var-conversion-precision-check branch from 48b5403 to 2d129c1 Compare March 11, 2025 09:45
…iable

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@matejk matejk force-pushed the 4886-fix-dynamic-var-conversion-precision-check branch from 318c4ff to 56ed979 Compare March 11, 2025 09:50
@matejk matejk merged commit 91244ac into main Mar 11, 2025
47 checks passed
@matejk matejk deleted the 4886-fix-dynamic-var-conversion-precision-check branch March 11, 2025 12:29
@matejk matejk moved this from In Progress to Done in 1.14 Mar 11, 2025
matejk added a commit that referenced this pull request Mar 11, 2025
* Take the absolute value of the value in numValDigits to fix the precision loss check for negative values.

* fix(VarHolder): Correct numValDigits to properly convert to signed integer.

* Potential fix for code scanning alert no. 1075: Declaration hides variable

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

---------

Co-authored-by: Mias <mias@innoventix.co.za>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@aleks-f
Copy link
Member

aleks-f commented Mar 19, 2025

this is causing warnings on windows:

C:\Users\alex\source\repos\pocoproject\poco\Foundation\include\Poco\Dynamic\VarHolder.h(478,51): warning C4146: unary minus operator applied to unsigned type, result still unsigned
1>(compiling source file 'src/JSONConfiguration.cpp')
1>    C:\Users\alex\source\repos\pocoproject\poco\Foundation\include\Poco\Dynamic\VarHolder.h(478,51):
1>    the template instantiation context (the oldest one first) is
1>        C:\Users\alex\source\repos\pocoproject\poco\Foundation\include\Poco\Dynamic\VarHolder.h(2124,3):
1>        see reference to function template instantiation 'void Poco::Dynamic::VarHolder::convertToFP<const Poco::UInt32,float,true,true>(F &,T &)' being compiled
1>        with
1>        [
1>            F=const Poco::UInt32,
1>            T=float
1>        ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Poco::Dynamic::Var conversion to floating point does not handle precision checks correctly for negative numbers.
3 participants