MantisBT - Community
View Issue Details
0023557Community[OCCT] OCCT:DRAWpublic2012-11-15 16:432013-04-29 15:23
Pawel 
omy 
normalminor 
closedfixed 
ALL
[OCCT] 6.5.4 
[OCCT] 6.6.0[OCCT] 6.6.0 
0023557: V547 Expression 'as1.ToCString() != ""' is always true. To compare strings you should use strcmp() function. qabugs_3.cxx,
In 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."
No tags attached.
child of 0023533closed omy Unitialized variables used, IntTools_TopolTool.cxx 
Issue History
2012-11-15 16:43PawelNew Issue
2012-11-15 16:43PawelAssigned To => bugmaster
2013-02-26 16:08abvAssigned Tobugmaster => omy
2013-02-26 16:08abvStatusnew => assigned
2013-02-26 17:52omyRelationship addedchild of 0023533
2013-03-04 20:04abvChangeset attached => occt master 5cbfdb41
2013-03-05 10:08bugmasterStatusassigned => resolved
2013-03-05 10:08bugmasterStatusresolved => reviewed
2013-03-05 10:08bugmasterStatusreviewed => verified
2013-03-05 10:08bugmasterResolutionopen => fixed
2013-04-23 13:35aivStatusverified => closed
2013-04-29 15:23aivFixed in Version => 6.6.0

There are no notes attached to this issue.