View Issue Details

IDProjectCategoryView StatusLast Update
0023332CommunityOCCT:Data Exchangepublic2012-11-16 13:17
ReporterPawel Assigned ToPawel  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformAOSL 
Product Version6.5.2 
Target Version6.5.4Fixed in Version6.5.4 
Summary0023332: Expression 'anIndex < 0' is always false. Unsigned type value is never < 0. in Vrmldata_Geometry.cxx
DescriptionIn 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).
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0023072 closeddbv Open CASCADE Eliminate compiler warnings (level 3) on Windows / MSVC++ 

Activities

Pawel

2012-07-20 14:59

developer   ~0021087

Corresponding git branch pushed. Please review.

abv

2012-07-23 14:20

manager   ~0021111

Last edited: 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

Pawel

2012-07-23 16:02

developer   ~0021116

No remarks. Please forward for testing.

apn

2012-07-25 11:12

administrator   ~0021143

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

Related Changesets

occt: master 8ad82602

2012-07-27 12:08:57

Pawel

Details Diff
0023332: Expression 'anIndex < 0' is always false. Unsigned type value is never < 0. in Vrmldata_Geometry.cxx

Examining index sign before casting to Standard_Size.

Argument of method VrmlData_ArrayVec3d::Value() changed from Standard_Integer to Standard_Size to be consistent with its use (avoid compiler warnings)
Affected Issues
0023332
mod - src/VrmlData/VrmlData_ArrayVec3d.hxx Diff File
mod - src/VrmlData/VrmlData_Geometry.cxx Diff File

Issue History

Date Modified Username Field Change
2012-07-20 14:33 Pawel New Issue
2012-07-20 14:33 Pawel Assigned To => Pawel
2012-07-20 14:59 Pawel Summary V547 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:59 Pawel Note Added: 0021087
2012-07-20 14:59 Pawel Assigned To Pawel => bugmaster
2012-07-20 14:59 Pawel Status new => resolved
2012-07-20 15:00 Pawel Relationship added related to 0023072
2012-07-23 14:20 abv Note Added: 0021111
2012-07-23 14:21 abv Assigned To bugmaster => Pawel
2012-07-23 14:23 abv Note Edited: 0021111
2012-07-23 16:02 Pawel Note Added: 0021116
2012-07-23 16:02 Pawel Assigned To Pawel => bugmaster
2012-07-23 16:02 Pawel Status resolved => reviewed
2012-07-25 11:12 apn Note Added: 0021143
2012-07-25 11:12 apn Test case number => Not needed
2012-07-25 11:12 apn Status reviewed => tested
2012-07-30 16:31 Pawel Changeset attached => occt master 8ad82602
2012-07-30 16:31 Pawel Assigned To bugmaster => Pawel
2012-07-30 16:31 Pawel Status tested => verified
2012-07-30 16:31 Pawel Resolution open => fixed
2012-11-16 13:14 bugmaster Fixed in Version => 6.5.4
2012-11-16 13:17 bugmaster Status verified => closed