You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "James E. King, III (JIRA)" <ji...@apache.org> on 2015/07/28 21:43:09 UTC

[jira] [Commented] (THRIFT-3068) C++ cppcheck warnings

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

James E. King, III commented on THRIFT-3068:
--------------------------------------------

cppcheck-1.69 on thrift-0.9.3-dev as of late last week:
{noformat}
jking@dvm-4:~$ cppcheck --force -j 4 --std=c++03 -q thrift/ | tee thrift.cppchk
[thrift/compiler/cpp/src/md5.c:207]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:208]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:209]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:210]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:211]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:212]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:213]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:214]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:215]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:216]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:217]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:218]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:219]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:220]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:221]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:222]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:233]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:234]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:235]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:236]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:237]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:238]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:239]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:240]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:241]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:242]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:243]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:244]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:245]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:246]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:247]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:248]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:259]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:260]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:261]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:262]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:263]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:264]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:265]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:266]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:267]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:268]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:269]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:270]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:271]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:272]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:273]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:274]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:285]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:286]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:287]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:288]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:289]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:290]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:291]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:292]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:293]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:294]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:295]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:296]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:297]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:298]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:299]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/md5.c:300]: (error) Uninitialized variable: X
[thrift/compiler/cpp/src/main.cc:359]: (error) Uninitialized variable: rp
[thrift/compiler/cpp/src/main.cc:381]: (error) Uninitialized variable: rp
[thrift/compiler/cpp/src/main.cc:1176]: (error) Uninitialized variable: old_thrift_file_rp
[thrift/compiler/cpp/src/main.cc:1245]: (error) Uninitialized variable: new_thrift_file_rp
[thrift/compiler/cpp/src/main.cc:1270]: (error) Uninitialized variable: rp
[thrift/lib/c_glib/test/testbufferedtransport.c:181]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testbufferedtransport.c:183]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testbufferedtransport.c:186]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testbufferedtransport.c:188]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testbufferedtransport.c:189]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testbufferedtransport.c:190]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:632]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:636]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:650]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:654]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:668]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:672]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:687]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:691]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:706]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:710]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:725]: (error) Uninitialized variable: b
[thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c:729]: (error) Uninitialized variable: b
[thrift/lib/c_glib/test/testframedtransport.c:255]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testframedtransport.c:257]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testframedtransport.c:259]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testframedtransport.c:260]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testframedtransport.c:261]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testframedtransport.c:263]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testtransportsocket.c:295]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testtransportsocket.c:297]: (error) Uninitialized variable: buf
[thrift/lib/c_glib/test/testtransportsocket.c:301]: (error) Uninitialized variable: buf
[thrift/lib/cpp/test/TMemoryBufferTest.cpp:90]: (error) Dereferencing 'str1' after it is deallocated / released
[thrift/lib/cpp/test/concurrency/ThreadFactoryTests.h:118]: (error) Memory is allocated but not initialized: activeCount
{noformat}

> C++ cppcheck warnings
> ---------------------
>
>                 Key: THRIFT-3068
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3068
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9.2
>            Reporter: James E. King, III
>            Priority: Minor
>
> These warnings were identified by cppcheck-1.68 on the thrift-0.9.2 codebase.  Many of them are inconsequential, and some may be intentional for performance:
> {noformat}[lib/cpp/src/thrift/async/TAsyncProcessor.h:62]: (warning) Member variable 'TAsyncProcessor::asyncServer_' is not initialized in the constructor.
> [lib/cpp/src/thrift/concurrency/FunctionRunner.h:82]: (warning) Member variable 'FunctionRunner::intervalMs_' is not initialized in the constructor.
> [lib/cpp/src/thrift/concurrency/FunctionRunner.h:89]: (warning) Member variable 'FunctionRunner::intervalMs_' is not initialized in the constructor.
> [lib/cpp/src/thrift/protocol/TJSONProtocol.h:262]: (warning) Member variable 'LookaheadReader::data_' is not initialized in the constructor.
> [lib/cpp/src/thrift/server/TNonblockingServer.cpp:1430]: (warning) %d in format string (no. 1) requires 'int' but the argument type is 'long'.
> [lib/cpp/src/thrift/transport/TFileTransport.h:96]: (warning) Member variable 'readState::eventSizeBuff_' is not initialized in the constructor.
> [lib/cpp/src/thrift/transport/TTransportUtils.h:91]: (warning) Member variable 'TPipedTransport::pipeOnRead_' is not initialized in the constructor.
> [lib/cpp/src/thrift/transport/TTransportUtils.h:91]: (warning) Member variable 'TPipedTransport::pipeOnWrite_' is not initialized in the constructor.
> [lib/cpp/src/thrift/transport/TTransportUtils.h:299] -> [lib/cpp/src/thrift/transport/TTransportUtils.h:200]: (warning) The class 'TPipedFileReaderTransport' defines member variable with name 'srcTrans_' also defined in its parent class 'TPipedTransport'.
> {noformat}
> The last one is curious enough that I filed this as a minor instead of a trivial defect to investigate.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)