Repository: thrift Updated Branches: refs/heads/master f31eba9d4 -> ec300e33d
THRIFT-1462 add more strict compiler flags Patch: Roger Meier Project: http://git-wip-us.apache.org/repos/asf/thrift/repo Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/ec300e33 Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/ec300e33 Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/ec300e33 Branch: refs/heads/master Commit: ec300e33d49bc57d8cc3b744ea16e5af615c8f94 Parents: f31eba9 Author: Roger Meier <[email protected]> Authored: Mon Oct 13 02:13:35 2014 +0200 Committer: Roger Meier <[email protected]> Committed: Mon Oct 13 02:13:35 2014 +0200 ---------------------------------------------------------------------- compiler/cpp/CMakeLists.txt | 7 ++++++- compiler/cpp/Makefile.am | 2 +- compiler/cpp/src/generate/t_delphi_generator.cc | 6 +++--- compiler/cpp/src/generate/t_lua_generator.cc | 2 +- lib/cpp/Makefile.am | 2 +- lib/cpp/test/Makefile.am | 2 +- test/cpp/Makefile.am | 2 +- tutorial/cpp/Makefile.am | 2 +- 8 files changed, 15 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/thrift/blob/ec300e33/compiler/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt index 548dec7..606bfcd 100644 --- a/compiler/cpp/CMakeLists.txt +++ b/compiler/cpp/CMakeLists.txt @@ -152,9 +152,14 @@ install(TARGETS thrift DESTINATION bin) # mingw32 does not support c++0x features if(NOT CMAKE_SYSTEM_NAME STREQUAL "Windows") -set(CMAKE_CXX_FLAGS "-std=c++0x") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") endif() +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") +endif() + + # create a Distribution Package for the Apache Thrift Compiler set(CPACK_PACKAGE_NAME "Apache Thrift") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apache Thrift Compiler") http://git-wip-us.apache.org/repos/asf/thrift/blob/ec300e33/compiler/cpp/Makefile.am ---------------------------------------------------------------------- diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am index 52b9c61..ee28d0c 100644 --- a/compiler/cpp/Makefile.am +++ b/compiler/cpp/Makefile.am @@ -93,7 +93,7 @@ thrift_SOURCES += src/generate/t_c_glib_generator.cc \ src/generate/t_lua_generator.cc thrift_CPPFLAGS = -I$(srcdir)/src -thrift_CXXFLAGS = -Wall +thrift_CXXFLAGS = -Wall -Wextra -pedantic thrift_LDADD = @LEXLIB@ libparse.a libparse_a_CPPFLAGS = -I$(srcdir)/src http://git-wip-us.apache.org/repos/asf/thrift/blob/ec300e33/compiler/cpp/src/generate/t_delphi_generator.cc ---------------------------------------------------------------------- diff --git a/compiler/cpp/src/generate/t_delphi_generator.cc b/compiler/cpp/src/generate/t_delphi_generator.cc index 19b8272..8185391 100644 --- a/compiler/cpp/src/generate/t_delphi_generator.cc +++ b/compiler/cpp/src/generate/t_delphi_generator.cc @@ -276,7 +276,7 @@ string t_delphi_generator::replace_all( string contents, string search, string r } return str; -}; +} // XML encoding string t_delphi_generator::xml_encode( string contents) { @@ -321,7 +321,7 @@ void t_delphi_generator::generate_delphi_docstring_comment(ostream &out, string "/// ", "<para>" + contents + "</para>", "/// </summary>\n{$ENDREGION}\n"); } -}; +} void t_delphi_generator::generate_delphi_doc(ostream &out, t_field* field) { if( xmldoc_) { @@ -3479,5 +3479,5 @@ THRIFT_REGISTER_GENERATOR(delphi, "delphi", " and container instances by interface or TypeInfo()\n" " constprefix: Name TConstants classes after IDL to reduce ambiguities\n" " events: Enable and use processing events in the generated code.\n" -" xmldoc: Enable XMLDoc comments for Help Insight etc.\n"); +" xmldoc: Enable XMLDoc comments for Help Insight etc.\n") http://git-wip-us.apache.org/repos/asf/thrift/blob/ec300e33/compiler/cpp/src/generate/t_lua_generator.cc ---------------------------------------------------------------------- diff --git a/compiler/cpp/src/generate/t_lua_generator.cc b/compiler/cpp/src/generate/t_lua_generator.cc index 0246797..6acc6a9 100644 --- a/compiler/cpp/src/generate/t_lua_generator.cc +++ b/compiler/cpp/src/generate/t_lua_generator.cc @@ -1224,4 +1224,4 @@ string t_lua_generator::type_to_enum(t_type* type) { throw "INVALID TYPE IN type_to_enum: " + type->get_name(); } -THRIFT_REGISTER_GENERATOR(lua, "Lua", ""); +THRIFT_REGISTER_GENERATOR(lua, "Lua", "") http://git-wip-us.apache.org/repos/asf/thrift/blob/ec300e33/lib/cpp/Makefile.am ---------------------------------------------------------------------- diff --git a/lib/cpp/Makefile.am b/lib/cpp/Makefile.am index 4bd40fb..668af0a 100755 --- a/lib/cpp/Makefile.am +++ b/lib/cpp/Makefile.am @@ -47,7 +47,7 @@ lib_LTLIBRARIES += libthriftqt.la pkgconfig_DATA += thrift-qt.pc endif -AM_CXXFLAGS = -Wall +AM_CXXFLAGS = -Wall -Wextra -pedantic AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(srcdir)/src AM_LDFLAGS = $(BOOST_LDFLAGS) http://git-wip-us.apache.org/repos/asf/thrift/blob/ec300e33/lib/cpp/test/Makefile.am ---------------------------------------------------------------------- diff --git a/lib/cpp/test/Makefile.am b/lib/cpp/test/Makefile.am index 012d226..751b0b3 100755 --- a/lib/cpp/test/Makefile.am +++ b/lib/cpp/test/Makefile.am @@ -268,7 +268,7 @@ gen-cpp/ChildService.cpp: processor/proc.thrift AM_CPPFLAGS = $(BOOST_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src AM_LDFLAGS = $(BOOST_LDFLAGS) -AM_CXXFLAGS = -Wall +AM_CXXFLAGS = -Wall -Wextra clean-local: $(RM) -r gen-cpp http://git-wip-us.apache.org/repos/asf/thrift/blob/ec300e33/test/cpp/Makefile.am ---------------------------------------------------------------------- diff --git a/test/cpp/Makefile.am b/test/cpp/Makefile.am index 3dbcaaa..3cf31a3 100755 --- a/test/cpp/Makefile.am +++ b/test/cpp/Makefile.am @@ -97,7 +97,7 @@ gen-cpp/StressTest_types.cpp gen-cpp/StressTest_constants.cpp: $(top_srcdir)/tes $(THRIFT) --gen cpp $< AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(LIBEVENT_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src -Igen-cpp -AM_CXXFLAGS = -Wall +AM_CXXFLAGS = -Wall -Wextra -pedantic AM_LDFLAGS = $(BOOST_LDFLAGS) $(LIBEVENT_LDFLAGS) clean-local: http://git-wip-us.apache.org/repos/asf/thrift/blob/ec300e33/tutorial/cpp/Makefile.am ---------------------------------------------------------------------- diff --git a/tutorial/cpp/Makefile.am b/tutorial/cpp/Makefile.am index 918adb2..bcc7654 100755 --- a/tutorial/cpp/Makefile.am +++ b/tutorial/cpp/Makefile.am @@ -63,7 +63,7 @@ gen-cpp/Calculator.cpp gen-cpp/tutorial_types.cpp gen-cpp/tutorial_constants.cpp $(THRIFT) --gen cpp -r $< AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(LIBEVENT_CPPFLAGS) -I$(top_srcdir)/lib/cpp/src -Igen-cpp -AM_CXXFLAGS = -Wall +AM_CXXFLAGS = -Wall -Wextra -pedantic AM_LDFLAGS = $(BOOST_LDFLAGS) $(LIBEVENT_LDFLAGS) clean-local:
