View Issue Details

IDProjectCategoryView StatusLast Update
0023557CommunityOCCT:DRAWpublic2013-04-29 15:23
ReporterPawel Assigned Toomy 
Status closedResolutionfixed 
Product Version6.5.4 
Target Version6.6.0Fixed in Version6.6.0 
Summary0023557: V547 Expression 'as1.ToCString() != ""' is always true. To compare strings you should use strcmp() function. qabugs_3.cxx,
DescriptionIn lines 1005 and 1008:

as1.ToCString() != ""
as2.ToCString() != ""

the conditions is always true, because pointers are compared.

Was this intended?
What is the intention of the method?

Some comment on that:
char *s ....
if (s == "Abcd")

This code still can print "TRUE" when the 's' variable and Test() function are defined in one module. The compiler does not produce a lot of identical constant strings but uses one string. As a result, the code sometimes seems quite operable. However, you must understand that this code is very bad and you should use special functions for comparison."
TagsNo tags attached.
Test case number


child of 0023533 closedomy Unitialized variables used, IntTools_TopolTool.cxx 


There are no notes attached to this issue.

Related Changesets

occt: master 5cbfdb41

2013-03-01 10:12:08


Details Diff
0023533: Unitialized variables used, IntTools_TopolTool.cxx

Also contains fixes for:

0023534: Unitialized variables used, ShapeAnalysis_TransferParameters.cxx
0023537: Uninitialized variable: MaxUserColor
0023538: Memory leak: cdata
0023557: V547 Expression 'as1.ToCString() != ""' is always true. To compare strings you should use strcmp() function. qabugs_3.cxx,
DRAW command for test bugs fclasses buc60724 corrected; test is OK now
Affected Issues
0023533, 0023534, 0023537, 0023538, 0023557
mod - src/IntTools/IntTools_TopolTool.cxx Diff File
mod - src/QABugs/QABugs_3.cxx Diff File
mod - src/ShapeAnalysis/ShapeAnalysis_TransferParameters.cxx Diff File
mod - src/Xw/Xw_ColorMap.cxx Diff File
mod - src/Xw/Xw_open_image.cxx Diff File
mod - tests/bugs/fclasses/buc60724 Diff File

Issue History

Date Modified Username Field Change
2012-11-15 16:43 Pawel New Issue
2012-11-15 16:43 Pawel Assigned To => bugmaster
2013-02-26 16:08 abv Assigned To bugmaster => omy
2013-02-26 16:08 abv Status new => assigned
2013-02-26 17:52 omy Relationship added child of 0023533
2013-03-04 20:04 abv Changeset attached => occt master 5cbfdb41
2013-03-05 10:08 bugmaster Status assigned => resolved
2013-03-05 10:08 bugmaster Status resolved => reviewed
2013-03-05 10:08 bugmaster Status reviewed => verified
2013-03-05 10:08 bugmaster Resolution open => fixed
2013-04-23 13:35 aiv Status verified => closed
2013-04-29 15:23 aiv Fixed in Version => 6.6.0