[cppcheck] Member variable 'gcd_result::gcd_degree' is not initialised in the constructor.
Hi, during a check with the static code analysis tool cppcheck of the current git head of cln, the tool discoverd a not initialized member variable of class gcd_result::gcd_degree. Please refer the attached patch that fixes the issue. Best regards from the cppcheck team Ettl Martin
Hi, Martin Ettl wrote:
during a check with the static code analysis tool cppcheck of the current git head of cln, the tool discoverd a not initialized member variable of class gcd_result::gcd_degree.
Please refer the attached patch that fixes the issue.
Thanks for running the cppcheck tool on CLN. But in this case, the report is a false positive: The only uses of the type gcd_result are in the same file, function cantor_zassenhaus_sqrt, and you can see in lines 154, 161, 168, that the 'gcd_degree' member is only used when the 'condition' member is NULL, and furthermore from function gcd you can see that when said constructor is used the 'condition' member is assigned a non-NULL value. So, the program is correct as is. Bruno
participants (2)
-
Bruno Haible
-
Martin Ettl