Tautological comparison (always evaluates to false) (Bug #3510)
Description
if( cat_var_count != cat_var_count || ord_var_count != ord_var_count )
CV_ERROR( CV_StsParseError, "var_type is inconsistent with cat_var_count and ord_var_count" );
//////
This code doesn't make sense because the if statement always evaluates to false.
It seems like this is supposed to catch a real issue but the if statement contains a bug.
This was caught by clang's -Wtautological-compare feature.
Associated revisions
Merge pull request #3510 from boaz001:feature-4057
History
Updated by Vladislav Vinogradov about 11 years ago
Hello Johann,
Thank you for reporting this issue!
Do you think you can try to fix this issue locally and send us a pull request? Your help would be very appreciated. Please read more details on how to contribute here: http://code.opencv.org/projects/opencv/wiki/How_to_contribute.
- Priority changed from Normal to Low
- Assignee changed from Maria Dimashova to Johann Rocholl
- Status changed from New to Open
Updated by Rick Mann almost 11 years ago
I saw this, too, but couldn't discern how to actually fix it.
Updated by Vadim Pisarevsky almost 10 years ago
I think, the bug has been fixed in 3.0-dev, at least I do not see such a comparison in tree.cpp
- Status changed from Open to Done