You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Christian Lavoie (JIRA)" <ji...@apache.org> on 2010/10/13 17:00:39 UTC

[jira] Commented: (THRIFT-916) gcc warnings in c++ header files

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

Christian Lavoie commented on THRIFT-916:
-----------------------------------------

Patch looks sane to me, but fails to build on my Mac:

{noformat}
Darwin -- 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386
i686-apple-darwin10-g++-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5664)
{noformat}

With the following error message:

{noformat}
$ ./bootstrap.sh 
$ export CFLAGS="-Wall -Werror -pedantic"
$ export CXXFLAGS="-Wall -Werror -pedantic"
$ export CPPFLAGS="-Wall -Werror -pedantic"
$ ./configure --prefix=$HOME/ports/src --with-cpp \
  --without-php --without-php_extension --without-perl \
  --without-python --without-ruby --without-haskell --without-java

[snip a lot]

g++ -DHAVE_CONFIG_H -I. -I../..   -Wall -Werror -pedantic -Wall -I./src -Wall -Werror -pedantic -MT thrift-t_java_generator.o -MD -MP -MF .deps/thrift-t_java_generator.Tpo -c -o thrift-t_java_generator.o `test -f 'src/generate/t_java_generator.cc' || echo './'`src/generate/t_java_generator.cc
cc1plus: warnings being treated as errors
src/generate/t_java_generator.cc: In member function 'void t_java_generator::generate_java_struct_clear(std::ofstream&, t_struct*)':
src/generate/t_java_generator.cc:3900: warning: enumeration value 'TYPE_VOID' not handled in switch
src/generate/t_java_generator.cc:3900: warning: enumeration value 'TYPE_STRING' not handled in switch
make[3]: *** [thrift-t_java_generator.o] Error 1
make[3]: *** Waiting for unfinished jobs....
mv -f .deps/thrift-t_cpp_generator.Tpo .deps/thrift-t_cpp_generator.Po
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
{noformat}

Did you disable the java generator, perchance?

> gcc warnings in c++ header files
> --------------------------------
>
>                 Key: THRIFT-916
>                 URL: https://issues.apache.org/jira/browse/THRIFT-916
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.4
>            Reporter: Piotr Bartosiewicz
>         Attachments: THRIFT-916_Wall_pedantic__noerrors.patch
>
>
> I tried to add an extra gcc warning options in my project but a number of warnings was emmited from thrift headers.
> Following the boost library recommendations, code should be clean with "-Wall -Wextra -pedantic" options. 
> Currently only with -Wall thrift has no warnings. 
> Other options worth considering (but require more work) are -Wconversion -Wold-style-cast
> So the task is to improve the thrift headers. 
> I suggest also update all the thrift makefiles so the thrift sources an tests will indicate the faulty code.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.