[ 
https://issues.apache.org/jira/browse/LOGCXX-434?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13981950#comment-13981950
 ] 

Christian Ehrlicher commented on LOGCXX-434:
--------------------------------------------

Here are the cppcheck warnings I fixed:
charsetencoder.cpp:403: The exception is caught by value. It could be caught as 
a (const) reference which is usually recommended in C++.

fileappender.cpp:278 & 281 odbcappender.cpp:186: Rethrowing an exception with 
'throw ex;' creates an unnecessary copy of 'ex'. To rethrow the caught 
exception without unnecessary copying or slicing, use a bare 'throw;'.

properties.cpp:299: The member function 'PropertyParser::get' can be made a 
static function. Making a function static can bring a performance benefit since 
no 'this' instance is passed to the function. This change should not cause 
compiler errors but it does not necessarily make sense conceptually. Think 
about your design and the task of the function first - is it a function that 
must not access members of class instances?

simpledateformat.cpp:215: Member variable 'NumericToken::zeroDigit' is not 
initialized in the constructor.
simpledateformat.cpp:441: Member variable 'HourToken::offset' is not 
initialized in the constructor.


> Fix some cppcheck warnings
> --------------------------
>
>                 Key: LOGCXX-434
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-434
>             Project: Log4cxx
>          Issue Type: Bug
>    Affects Versions: 0.11.0
>         Environment: openSUSE 13.1 / 64 Bit
>            Reporter: Christian Ehrlicher
>            Priority: Minor
>         Attachments: logcxx-434.patch
>
>
> The attached patch fixes some cppcheck warnings. They're not really important 
> (except the uninitialized variable in HourToken class ) but I found them 
> during my tests with cppcheck on recent svn HEAD. It's good to see that these 
> warnings are the only noticeable warnings from cppcheck :)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to