MantisBT - Community
View Issue Details
0023332Community[OCCT] OCCT:Data Exchangepublic2012-07-20 14:332012-11-16 13:17
Pawel 
Pawel 
normalminor 
closedfixed 
ALL
[OCCT] 6.5.2 
[OCCT] 6.5.4[OCCT] 6.5.4 
Not needed
0023332: Expression 'anIndex < 0' is always false. Unsigned type value is never < 0. in Vrmldata_Geometry.cxx
In line 75

 size_t anIndex = (size_t)i;
  if (anIndex < 0 || anIndex >= myLength) {
    static gp_XYZ anOrigin (0., 0., 0.);
    return anOrigin;
  }

As a solution I would check the variable before casting to size_t (or better to Standard_Size).
No tags attached.
related to 0023072closed dbv Open CASCADE Eliminate compiler warnings (level 3) on Windows / MSVC++ 
Issue History
2012-07-20 14:33PawelNew Issue
2012-07-20 14:33PawelAssigned To => Pawel
2012-07-20 14:59PawelSummaryV547 Expression 'anIndex < 0' is always false. Unsigned type value is never < 0. in Vrmldata_Geometry.cxx => Expression 'anIndex < 0' is always false. Unsigned type value is never < 0. in Vrmldata_Geometry.cxx
2012-07-20 14:59PawelNote Added: 0021087
2012-07-20 14:59PawelAssigned ToPawel => bugmaster
2012-07-20 14:59PawelStatusnew => resolved
2012-07-20 15:00PawelRelationship addedrelated to 0023072
2012-07-23 14:20abvNote Added: 0021111
2012-07-23 14:21abvAssigned Tobugmaster => Pawel
2012-07-23 14:23abvNote Edited: 0021111bug_revision_view_page.php?bugnote_id=21111#r4075
2012-07-23 16:02PawelNote Added: 0021116
2012-07-23 16:02PawelAssigned ToPawel => bugmaster
2012-07-23 16:02PawelStatusresolved => reviewed
2012-07-25 11:12apnNote Added: 0021143
2012-07-25 11:12apnTest case number => Not needed
2012-07-25 11:12apnStatusreviewed => tested
2012-07-30 16:31PawelChangeset attached => occt master 8ad82602
2012-07-30 16:31PawelAssigned Tobugmaster => Pawel
2012-07-30 16:31PawelStatustested => verified
2012-07-30 16:31PawelResolutionopen => fixed
2012-11-16 13:14bugmasterFixed in Version => 6.5.4
2012-11-16 13:17bugmasterStatusverified => closed

Notes
(0021087)
Pawel   
2012-07-20 14:59   
Corresponding git branch pushed. Please review.
(0021111)
abv   
2012-07-23 14:20   
(edited on: 2012-07-23 14:23)
I have simplified the fix by converting type of the argument of method Value() to Standard_Size; this is consistent with its use and makes check for its sign unnecessary. Please review

(0021116)
Pawel   
2012-07-23 16:02   
No remarks. Please forward for testing.
(0021143)
apn   
2012-07-25 11:12   
Dear BugMaster,
The workbenches
KAS:dev:apn-23332-occt (GIT branch CR23332)
KAS:dev:apn-23332-products (GIT master)
were compiled on Linux platform and tested.

Regression:
Not detected

Improvements:
Not detected

Testing case:
Not needed

See results in /QADisk/occttests/results/KAS/dev/apn-23332-products_24072012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120706-opt_06072012/lin
See test cases in /QADisk/occttests/tests/ED