summaryrefslogtreecommitdiff
path: root/compiler/cpp
diff options
context:
space:
mode:
authorRoger Meier <roger@apache.org>2014-10-13 02:13:35 +0200
committerRoger Meier <roger@apache.org>2014-10-13 02:13:35 +0200
commitec300e33d49bc57d8cc3b744ea16e5af615c8f94 (patch)
tree190f770232414f8b8e3eea94fb7a87a11d24aa43 /compiler/cpp
parentf31eba9d459bb927be3af7f608a3c4e8cd0174e0 (diff)
downloadthrift-ec300e33d49bc57d8cc3b744ea16e5af615c8f94.tar.gz
THRIFT-1462 add more strict compiler flags
Patch: Roger Meier
Diffstat (limited to 'compiler/cpp')
-rw-r--r--compiler/cpp/CMakeLists.txt7
-rw-r--r--compiler/cpp/Makefile.am2
-rw-r--r--compiler/cpp/src/generate/t_delphi_generator.cc6
-rw-r--r--compiler/cpp/src/generate/t_lua_generator.cc2
4 files changed, 11 insertions, 6 deletions
diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt
index 548dec73b..606bfcd5b 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")
diff --git a/compiler/cpp/Makefile.am b/compiler/cpp/Makefile.am
index 52b9c61dc..ee28d0c1f 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
diff --git a/compiler/cpp/src/generate/t_delphi_generator.cc b/compiler/cpp/src/generate/t_delphi_generator.cc
index 19b827243..81853918c 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")
diff --git a/compiler/cpp/src/generate/t_lua_generator.cc b/compiler/cpp/src/generate/t_lua_generator.cc
index 02467977d..6acc6a99c 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", "")