Просмотр исходного кода

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

Make sure the diagnostics are outside the function body, as required by some
vintages of gcc.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 лет назад
Родитель
Сommit
0f3042805f
1 измененных файлов с 8 добавлено и 8 удалено
  1. 8 8
      ecl/hqlcpp/hqlcpp.cpp

+ 8 - 8
ecl/hqlcpp/hqlcpp.cpp

@@ -11676,20 +11676,20 @@ void HqlCppTranslator::buildCppFunctionDefinition(BuildCtx &funcctx, IHqlExpress
         startLine += memcount(body-start, start, '\n');
     }
 
-    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");
+            "#pragma GCC diagnostic error \"-Wall\"\n"
+            "#pragma GCC diagnostic error \"-Wextra\"\n"
+            "#endif\n");
+
+    funcctx.addQuotedCompound(proto, "\n#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");
     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)