You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ben Craig (JIRA)" <ji...@apache.org> on 2015/03/31 16:14:53 UTC

[jira] [Commented] (THRIFT-3063) C++ build -Wunused-parameter warnings on processor_test, TransportTest

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

Ben Craig commented on THRIFT-3063:
-----------------------------------

Visual Studio /W4 has a similar warning ( C4100 ).

To be honest though, I'm not really sure what the value in this warning is.  I have fixed this kind of warning hundreds of times. I don't think I've resolved a single bug, or made unclear code more clear as a result of removing the named parameter.  In fact, my typical way to fix something like "void bindSuccessful(uint16_t port)" is to transform it into "void bindSuccessful(uint16_t /* port */)"

> C++ build -Wunused-parameter warnings on processor_test, TransportTest
> ----------------------------------------------------------------------
>
>                 Key: THRIFT-3063
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3063
>             Project: Thrift
>          Issue Type: Bug
>          Components: C++ - Library
>    Affects Versions: 0.9.2
>         Environment: linux, Ubuntu 14.04 LTS
>            Reporter: James E. King, III
>            Priority: Trivial
>
> During a build the following compiler warnings appear:
> {noformat}libtool: link: g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -o .libs/Benchmark Benchmark.o  -L/usr/lib/x86_64-linux-gnu ./.libs/libtestgencpp.a /home/svtbuild/stash/pkgs/thrift2/lib/cpp/.libs/libthrift.so -lssl -lcrypto -lrt -lpthread
> In file included from processor/ServerThread.cpp:22:0:
> processor/ServerThread.h:64:16: warning: unused parameter ‘port’ [-Wunused-parameter]
>    virtual void bindSuccessful(uint16_t port) {
>                 ^
> In file included from processor/ProcessorTest.cpp:39:0:
> processor/ServerThread.h:64:16: warning: unused parameter ‘port’ [-Wunused-parameter]
>    virtual void bindSuccessful(uint16_t port) {
>                 ^
> In file included from processor/ProcessorTest.cpp:40:0:
> processor/Handlers.h:228:16: warning: unused parameter ‘serverContext’ [-Wunused-parameter]
>    virtual void processContext(
>                 ^
> processor/Handlers.h:228:16: warning: unused parameter ‘transport’ [-Wunused-parameter]
> processor/Handlers.h:287:8: warning: unused parameter ‘bytes’ [-Wunused-parameter]
>    void postRead(void* ctx, const char* fnName, uint32_t bytes) {
>         ^
> processor/Handlers.h:301:8: warning: unused parameter ‘bytes’ [-Wunused-parameter]
>    void postWrite(void* ctx, const char* fnName, uint32_t bytes) {
>         ^
> processor/ProcessorTest.cpp:936:24: warning: unused parameter ‘argc’ [-Wunused-parameter]
>  unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) {
>                         ^
> processor/ProcessorTest.cpp:936:24: warning: unused parameter ‘argv’ [-Wunused-parameter]
> /bin/bash ../../../libtool  --tag=CXX   --mode=link g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -L/usr/lib/x86_64-linux-gnu  -o processor_test processor/ProcessorTest.o processor/EventLog.o processor/ServerThread.o libprocessortest.la ../../../lib/cpp/libthrift.la ../../../lib/cpp/libthriftnb.la -L/usr/lib/x86_64-linux-gnu -levent -l:libboost_unit_test_framework.a -lssl -lcrypto -lrt -lpthread 
> libtool: link: g++ -Wall -Wextra -pedantic -g -O2 -std=c++11 -o .libs/processor_test processor/ProcessorTest.o processor/EventLog.o processor/ServerThread.o  -L/usr/lib/x86_64-linux-gnu ./.libs/libprocessortest.a ../../../lib/cpp/.libs/libthrift.so ../../../lib/cpp/.libs/libthriftnb.so -levent -l:libboost_unit_test_framework.a -lssl -lcrypto -lrt -lpthread{noformat}
> {noformat}
> 	g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src/thrift  -I/usr/include -I../../../lib/cpp/src  -Wall -Wextra -pedantic -g -O2 -std=c++11 -MT TransportTest.o -MD -MP -MF $depbase.Tpo -c -o TransportTest.o TransportTest.cpp &&\
> 	mv -f $depbase.Tpo $depbase.Po
> TransportTest.cpp:1048:31: warning: unused parameter ‘argc’ [-Wunused-parameter]
>  boost::unit_test::test_suite* init_unit_test_suite(int argc, char* argv[]) {
>                                ^
> TransportTest.cpp:1048:31: warning: unused parameter ‘argv’ [-Wunused-parameter]
> {noformat}



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