View Issue Details

IDProjectCategoryView StatusLast Update
0023498Open CASCADEOCCT:Foundation Classespublic2013-04-29 15:21
ReporterabvAssigned Toabv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version6.5.4 
Target Version6.6.0Fixed in Version6.6.0 
Summary0023498: Comparison always true in Units_Lexicon::Creates()
DescriptionThe problem is caused by fix on 0023072 and has been reported by Pawel in note 0023072:0020967:

-----

In Units_Lexicon.cxx, Units_Lexicon::Creates() comparing 'i' against 0 (lower, greater or equal) in lines 115, 117, 119, 122

     while( i>=0 && ( chain[i] == ' ' || !chain[i] ))
       chain[i--]=0;
     if(i<0) continue;
     i=9;
     while( i>=0 && ( oper [i] == ' ' || !oper [i] ))
       oper[i--]=0;
     i=29;
     while( i>=0 && ( coeff[i] == ' ' || !coeff[i] ))
       coeff[i--]=0;

 is either always 'true' (line 119, 122) or 'false' (lines 115, 117) because 'i' was declared to be of type 'Standard_Size' and so is unsigned. As I'm not sure about the functionality of the method I can't say whether this is critical or not.

 Consider changing the type of 'i' back to 'Standard_Integer' (although it produces a warning) or changing the logic in the method.
TagsNo tags attached.
Test case numberNot needed

Relationships

child of 0023072 closeddbv Eliminate compiler warnings (level 3) on Windows / MSVC++ 

Activities

abv

2012-10-30 07:32

manager   ~0021998

The code of methods Creates() in Units_Lexicon and Units_UnitDictionary has been refactored, please review branch CR23498

kgv

2012-11-23 10:08

developer   ~0022367

Patch reviewed without remarks.

mkv

2012-11-26 14:01

tester   ~0022386

Dear BugMaster,
Branch CR23498 (and products from GIT master) was compiled on Linux and Windows platforms and tested.

Regressions:
Not detected

Improvements:
Not detected

Testing cases:
Not needed

Related Changesets

occt: master 529b95df

2012-11-30 11:31:27

abv


Committer: abv Details Diff
0023498: Comparison always true in Units_Lexicon::Creates()

Method Units_Lexicon::Creates refactored
Further refactoring of Units_Lexicon::Creates() and Units_UnitsDictionary::Creates()
Affected Issues
0023498
mod - src/Units/Units_Lexicon.cxx Diff File
mod - src/Units/Units_UnitsDictionary.cxx Diff File

Issue History

Date Modified Username Field Change
2012-10-30 07:26 abv New Issue
2012-10-30 07:26 abv Assigned To => abv
2012-10-30 07:30 abv Relationship added child of 0023072
2012-10-30 07:32 abv Note Added: 0021998
2012-10-30 07:32 abv Assigned To abv => kgv
2012-10-30 07:32 abv Status new => resolved
2012-11-23 10:08 kgv Note Added: 0022367
2012-11-23 10:08 kgv Assigned To kgv => bugmaster
2012-11-23 10:08 kgv Status resolved => reviewed
2012-11-23 16:51 mkv Assigned To bugmaster => mkv
2012-11-26 14:01 mkv Note Added: 0022386
2012-11-26 14:01 mkv Test case number => Not needed
2012-11-26 14:01 mkv Assigned To mkv => bugmaster
2012-11-26 14:01 mkv Status reviewed => tested
2012-12-04 13:21 abv Changeset attached => occt master 529b95df
2012-12-04 13:21 abv Assigned To bugmaster => abv
2012-12-04 13:21 abv Status tested => verified
2012-12-04 13:21 abv Resolution open => fixed
2012-12-10 17:16 abv Changeset attached => occt master 529b95df
2013-04-23 13:37 aiv Status verified => closed
2013-04-29 15:21 aiv Fixed in Version => 6.6.0