T
tim
We've started to use a coding standards checker at work. The following
code results in a warning:
38: CPlainText::CPlainText(const char *szPath,bool bTimeStamp,bool
bSaveLast)
39: :CLog()//call base class constructor to initialize members
40: {
41:
42: m_bTimeStamp=bTimeStamp;
43: try
44: {
45:
46:
47: if( true == bSaveLast )
^
Msg(2:3051) Be aware that an implicit conversion from 'bool' to 'int'
takes place.
48: {
49: CLog::SaveLastRunLog( szPath );
50: }
51:
The warning is flagged at line 47. Since the parameter is type bool,
and the 'true' is a bool, is there an implicit conversion taking place?
Yes, I've just spotted that the sub-class attributes arent in the
initialization list
===
I'm also interested in how others have found coding standard checkers.
Have they improved productivity, maintainability?
Thanks
Tim
code results in a warning:
38: CPlainText::CPlainText(const char *szPath,bool bTimeStamp,bool
bSaveLast)
39: :CLog()//call base class constructor to initialize members
40: {
41:
42: m_bTimeStamp=bTimeStamp;
43: try
44: {
45:
46:
47: if( true == bSaveLast )
^
Msg(2:3051) Be aware that an implicit conversion from 'bool' to 'int'
takes place.
48: {
49: CLog::SaveLastRunLog( szPath );
50: }
51:
The warning is flagged at line 47. Since the parameter is type bool,
and the 'true' is a bool, is there an implicit conversion taking place?
Yes, I've just spotted that the sub-class attributes arent in the
initialization list
===
I'm also interested in how others have found coding standard checkers.
Have they improved productivity, maintainability?
Thanks
Tim