MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0023332Community[OCCT] OCCT:Data Exchangepublic2012-07-20 14:332012-11-16 13:17
ReporterPawel 
Assigned ToPawel 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformAOSLOS VersionL
Product Version[OCCT] 6.5.2 
Target Version[OCCT] 6.5.4Fixed in Version[OCCT] 6.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
Attached Files

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

-  Notes
(0021087)
Pawel (developer)
2012-07-20 14:59

Corresponding git branch pushed. Please review.
(0021111)
abv (manager)
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 (developer)
2012-07-23 16:02

No remarks. Please forward for testing.
(0021143)
apn (administrator)
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

- Related Changesets
occt: master 8ad82602
Timestamp: 2012-07-27 12:08:57
Author: 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)
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 View Revisions
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


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker