Browse Source

Merge pull request #7869 from richardkchapman/cpperrors

HPCC-14388 Force full warnings as errors for embedded C++

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 9 năm trước cách đây
mục cha
commit
414b2edeb9
3 tập tin đã thay đổi với 16 bổ sung0 xóa
  1. 8 0
      ecl/hqlcpp/hqlcpp.cpp
  2. 4 0
      rtl/ecltpl/childtpl.cpp
  3. 4 0
      rtl/ecltpl/thortpl.cpp

+ 8 - 0
ecl/hqlcpp/hqlcpp.cpp

@@ -11677,11 +11677,19 @@ void HqlCppTranslator::buildCppFunctionDefinition(BuildCtx &funcctx, IHqlExpress
     }
 
     funcctx.addQuotedCompound(proto);
+    funcctx.addQuoted("#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))\n"
+                      "#pragma GCC diagnostic error \"-Wall\"\n"
+                      "#pragma GCC diagnostic error \"-Wextra\"\n"
+                      "#endif\n");
     if (location)
         funcctx.addLine(locationFilename, startLine);
     funcctx.addQuoted(body);
     if (location)
         funcctx.addLine();
+    funcctx.addQuoted("#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))\n"
+                      "#pragma GCC diagnostic ignored \"-Wall\"\n
+                      "#pragma GCC diagnostic ignored \"-Wextra\"\n"
+                      "#endif\n");
 }
 
 void HqlCppTranslator::buildScriptFunctionDefinition(BuildCtx &funcctx, IHqlExpression * funcdef, const char *proto)

+ 4 - 0
rtl/ecltpl/childtpl.cpp

@@ -16,6 +16,10 @@ $?doNotIncludeInGeneratedCode$
 ##############################################################################*/
 
 $?$/* Template for generating a child module for query */
+#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
+#pragma GCC diagnostic ignored "-Wall"
+#pragma GCC diagnostic ignored "-Wextra"
+#endif
 #include "eclinclude4.hpp"
 @include@
 @prototype@

+ 4 - 0
rtl/ecltpl/thortpl.cpp

@@ -16,6 +16,10 @@ $?doNotIncludeInGeneratedCode$
 ############################################################################## */
 
 $?$/* Template for generating thor/hthor/roxie output */
+#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
+#pragma GCC diagnostic ignored "-Wall"
+#pragma GCC diagnostic ignored "-Wextra"
+#endif
 #include "eclinclude4.hpp"
 @include@
 @prototype@