Prechádzať zdrojové kódy

Merge pull request #13242 from ghalliday/issue22968

HPCC-22968 Enable -Wall on the code generator sources

Reviewed-By: Shamser Ahmed <shamser.ahmed@lexisnexis.co.uk>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 rokov pred
rodič
commit
989af29e9a
55 zmenil súbory, kde vykonal 202 pridanie a 396 odobranie
  1. 4 0
      common/deftype/CMakeLists.txt
  2. 1 5
      common/deftype/deftype.cpp
  3. 2 2
      common/deftype/deftype.ipp
  4. 14 0
      ecl/hql/CMakeLists.txt
  5. 2 0
      ecl/hql/hql.hpp
  6. 2 2
      ecl/hql/hqlattr.cpp
  7. 2 2
      ecl/hql/hqlcache.cpp
  8. 1 1
      ecl/hql/hqlcollect.cpp
  9. 1 7
      ecl/hql/hqldesc.cpp
  10. 0 1
      ecl/hql/hqlerror.cpp
  11. 11 25
      ecl/hql/hqlexpr.cpp
  12. 1 1
      ecl/hql/hqlexpr.hpp
  13. 0 46
      ecl/hql/hqlfilter.cpp
  14. 6 19
      ecl/hql/hqlfold.cpp
  15. 1 1
      ecl/hql/hqlgram.hpp
  16. 1 3
      ecl/hql/hqlgram.y
  17. 6 37
      ecl/hql/hqlgram2.cpp
  18. 14 14
      ecl/hql/hqlir.cpp
  19. 4 2
      ecl/hql/hqlopt.cpp
  20. 4 8
      ecl/hql/hqlparse.cpp
  21. 1 1
      ecl/hql/hqlpmap.cpp
  22. 0 15
      ecl/hql/hqlscope.cpp
  23. 3 5
      ecl/hql/hqlthql.cpp
  24. 5 2
      ecl/hql/hqltrans.cpp
  25. 0 2
      ecl/hql/hqlusage.cpp
  26. 1 9
      ecl/hql/hqlutil.cpp
  27. 1 1
      ecl/hql/hqlutil.hpp
  28. 0 14
      ecl/hql/hqlwuerr.cpp
  29. 5 0
      ecl/hqlcpp/CMakeLists.txt
  30. 1 1
      ecl/hqlcpp/hqlcfilter.hpp
  31. 0 1
      ecl/hqlcpp/hqlckey.cpp
  32. 5 4
      ecl/hqlcpp/hqlcpp.cpp
  33. 3 3
      ecl/hqlcpp/hqlcpp.ipp
  34. 6 7
      ecl/hqlcpp/hqlcppds.cpp
  35. 1 1
      ecl/hqlcpp/hqlcse.cpp
  36. 0 2
      ecl/hqlcpp/hqlecl.cpp
  37. 1 1
      ecl/hqlcpp/hqlhoist.hpp
  38. 10 42
      ecl/hqlcpp/hqlhtcpp.cpp
  39. 6 6
      ecl/hqlcpp/hqlhtcpp.ipp
  40. 8 13
      ecl/hqlcpp/hqliproj.cpp
  41. 1 1
      ecl/hqlcpp/hqliter.ipp
  42. 1 1
      ecl/hqlcpp/hqllib.cpp
  43. 1 1
      ecl/hqlcpp/hqlregex.cpp
  44. 1 1
      ecl/hqlcpp/hqlres.cpp
  45. 5 3
      ecl/hqlcpp/hqlresource.cpp
  46. 1 1
      ecl/hqlcpp/hqlresource.ipp
  47. 1 1
      ecl/hqlcpp/hqlsource.cpp
  48. 2 2
      ecl/hqlcpp/hqlstmt.cpp
  49. 1 2
      ecl/hqlcpp/hqltcppc.cpp
  50. 0 1
      ecl/hqlcpp/hqltcppc2.cpp
  51. 4 24
      ecl/hqlcpp/hqlttcpp.cpp
  52. 1 3
      ecl/hqlcpp/hqlwcpp.cpp
  53. 47 47
      rtl/eclrtl/rtlfield.hpp
  54. 1 1
      system/jlib/jexcept.cpp
  55. 1 1
      system/jlib/jexcept.hpp

+ 4 - 0
common/deftype/CMakeLists.txt

@@ -43,6 +43,10 @@ include_directories (
          ./../../system/jlib 
     )
 
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+  SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-switch -Wno-unused-parameter -Werror -Wno-error=delete-non-virtual-dtor -Wimplicit-fallthrough=3")
+endif()
+
 ADD_DEFINITIONS( -D_USRDLL -DDEFTYPE_EXPORTS )
 
 HPCC_ADD_LIBRARY( deftype SHARED ${SRCS} )

+ 1 - 5
common/deftype/deftype.cpp

@@ -2020,7 +2020,7 @@ void ClearTypeCache()
     }
     for (i = 0; i < _elements_in(bftt); i++)
     {
-        int j;
+        unsigned j;
         for (j = 0; j < _elements_in(bftt[0]); j++)
             ReleaseAndClear(bftt[i][j]);
     }
@@ -2995,10 +2995,6 @@ ICharsetInfo * getCharset(IAtom * atom)
 
 ICollationInfo * getCollation(IAtom * atom)
 {
-#if _DEBUG
-    const char* name = str(atom);
-#endif
-
     if ((atom == NULL) || (atom == asciiAtom) || (atom == dataAtom) || (atom == utf8Atom))
     {
         if (!asciiCollation)

+ 2 - 2
common/deftype/deftype.ipp

@@ -133,8 +133,8 @@ public:
     }
 
 protected:
-    Owned<ICollationInfo> collation;
     Owned<ICharsetInfo> charset;
+    Owned<ICollationInfo> collation;
 };
 
 class CUnicodeTypeInfo : public CTypeInfo
@@ -327,7 +327,7 @@ protected:
     bool  typeIsSigned;
 
 public:
-    enum { UNKNOWN_DIGITS = 0xff };
+    static constexpr byte UNKNOWN_DIGITS = 0xff;
     IValue * createValueFromStack(void);
 
     CDecimalTypeInfo(unsigned _digits, unsigned _prec, bool _isSigned);

+ 14 - 0
ecl/hql/CMakeLists.txt

@@ -147,6 +147,20 @@ add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hqllex.cpp
     DEPENDS hqllex.l
 )
 
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+  SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-switch -Wno-unused-parameter -Werror -Wno-error=delete-non-virtual-dtor -Wimplicit-fallthrough=3")
+
+  #Compiler complains about a memcpy of a structure that contains a union
+  if (CMAKE_COMPILER_IS_GNUCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "8.0.0")
+    set_source_files_properties (hqlgram.cpp PROPERTIES COMPILE_FLAGS " -Wno-error=class-memaccess")
+  endif()
+
+  #Compiler complains about an unused function yyunput
+  set_source_files_properties (hqllex.cpp PROPERTIES COMPILE_FLAGS " -Wno-error=unused-function")
+  #gcc incorrectly thinks that a function that never returns can fall through
+  set_source_files_properties (hqlfilter.cpp PROPERTIES COMPILE_FLAGS " -Wimplicit-fallthrough=0")
+endif()
+
 if (WIN32)
     set_source_files_properties (hqlgram.cpp PROPERTIES COMPILE_FLAGS "/Od")
 endif()

+ 2 - 0
ecl/hql/hql.hpp

@@ -72,6 +72,7 @@ typedef const char * user_t;
 
 enum object_type 
 {
+    ob_none         = 0x0000,
 //Flags set on symbols
     ob_private      = 0x0000,
     ob_exported     = 0x0001,
@@ -120,6 +121,7 @@ struct HQL_API ECLlocation
 {
 public:
     inline ECLlocation() {}
+    ECLlocation(const ECLlocation & other) = default;
     ECLlocation(const IHqlExpression * _expr) { if (!extractLocationAttr(_expr)) clear(); }
     ECLlocation(int _line, int _column, int _position, ISourcePath * _sourcePath) { set(_line, _column, _position, _sourcePath); }
 

+ 2 - 2
ecl/hql/hqlattr.cpp

@@ -2186,7 +2186,7 @@ unsigned getCardinality(IHqlExpression * expr)
                 if (cardinality)
                     return (unsigned)getIntValue(cardinality);
             }
-            //fall through:
+            //fallthrough
         default:
             return expr->queryType()->getCardinality();
         }
@@ -2241,7 +2241,7 @@ const char * const magnitudeText[] = {
     "disk",
     "unknown"
 };
-inline RowCountMagnitude getRowCountMagnitude(__int64 num)
+inline RowCountMagnitude getRowCountMagnitude(unsigned __int64 num)
 {
     if (num == 0)
         return RCMnone;

+ 2 - 2
ecl/hql/hqlcache.cpp

@@ -127,7 +127,7 @@ protected:
     {
         if (!cacheTree)
             return false;
-        if (optionHash != cacheTree->getPropInt64("@hash"))
+        if (optionHash != (hash64_t)cacheTree->getPropInt64("@hash"))
             return false;
         return EclCachedDefinition::calcUpToDate(optionHash);
     }
@@ -395,8 +395,8 @@ protected:
     void createArchiveItem(const char * fullName, IEclSource * original);
 
 protected:
+    IEclCachedDefinitionCollection * collection = nullptr;
     Linked<IPropertyTree> archive;
-    IEclCachedDefinitionCollection * collection;
 };
 
 

+ 1 - 1
ecl/hql/hqlcollect.cpp

@@ -57,7 +57,7 @@ public:
 class CEclSource : public CInterfaceOf<IEclSource>
 {
 public:
-    CEclSource(IIdAtom * _eclId, EclSourceType _type) : eclId(_eclId), type(_type) { }
+    CEclSource(IIdAtom * _eclId, EclSourceType _type) : type(_type), eclId(_eclId)  { }
 
 //interface IEclSource
     virtual IProperties * getProperties() { return NULL; }

+ 1 - 7
ecl/hql/hqldesc.cpp

@@ -88,12 +88,6 @@ static int compareSymbolsByPosition(IInterface * const * pleft, IInterface * con
     return stricmp(str(left->queryName()), str(right->queryName()));
 }
 
-static void setNonZeroPropInt(IPropertyTree * tree, const char * path, int value)
-{
-    if (value)
-        tree->setPropInt(path, value);
-}
-
 static void expandRecordSymbolsMeta(IPropertyTree *, IHqlExpression *);
 
 void expandType(IPropertyTree * def, ITypeInfo * type)
@@ -153,8 +147,8 @@ void expandType(IPropertyTree * def, ITypeInfo * type)
                 IPropertyTree * ptype = ptree->addPropTree("Type");
                 expandType(ptype, params->queryChild(i)->queryType());
             }
-            //fallthrough
         }
+            //fallthrough
         case type_set:
         case type_row:
         case type_pattern:

+ 0 - 1
ecl/hql/hqlerror.cpp

@@ -191,7 +191,6 @@ public:
         const char * filename = error->getFilename();
         unsigned line = error->getLine();
         unsigned column = error->getColumn();
-        unsigned position = error->getPosition();
 
         StringBuffer msg;
         error->errorMessage(msg);

+ 11 - 25
ecl/hql/hqlexpr.cpp

@@ -1127,8 +1127,8 @@ void HqlParseContext::finishMeta(bool isSeparateFile, bool success, bool generat
 
     if (generateMeta)
     {
-        IPropertyTree* tos = curMeta().meta;
 #if 0
+        IPropertyTree* tos = curMeta().meta;
 # This is disabled as the location of the cache file needs to be
 # in the original location for now.  This may re-visited in the future.
         if (isSeparateFile && hasCacheLocation())
@@ -6664,7 +6664,7 @@ bool CHqlDataset::equals(const IHqlExpression & r) const
 {
     if (CHqlExpressionWithType::equals(r))
     {
-        const CHqlDataset & other = (const CHqlDataset &)r;
+        //const CHqlDataset & other = (const CHqlDataset &)r;
         //No need to check name - since it is purely derived from one of the arguments
         return true;
     }
@@ -7007,7 +7007,7 @@ void CHqlRecord::insertSymbols(IHqlExpression * expr)
         break;
     case no_ifblock:
         expr = expr->queryChild(1);
-        //fall through:
+        //fallthrough
     case no_record:
         {
             ForEachChild(idx, expr)
@@ -7572,7 +7572,7 @@ IHqlExpression *CHqlSymbolAnnotation::queryExpression()
 
 inline unsigned combineSymbolFlags(unsigned symbolFlags, bool exported, bool shared)
 {
-    return symbolFlags | (exported ? ob_exported : 0) | (shared ? ob_shared : 0);
+    return symbolFlags | (exported ? ob_exported : ob_none) | (shared ? ob_shared : ob_none);
 }
 
 CHqlSimpleSymbol::CHqlSimpleSymbol(IIdAtom * _id, IIdAtom * _module, IHqlExpression *_expr, IHqlExpression * _funcdef, unsigned _symbolFlags)
@@ -7868,9 +7868,9 @@ IHqlExpression * createLocationAnnotation(IHqlExpression * _ownedBody, const ECL
 IHqlExpression * createLocationAnnotation(IHqlExpression * ownedBody, ISourcePath * sourcePath, int lineno, int column)
 {
 #ifdef _DEBUG
-    assertex(lineno != 0xdddddddd && column != 0xdddddddd);
-    assertex(lineno != 0xcdcdcdcd && column != 0xcdcdcdcd);
-    assertex(lineno != 0xcccccccc && column != 0xcccccccc);
+    assertex((unsigned)lineno != 0xdddddddd && (unsigned)column != 0xdddddddd);
+    assertex((unsigned)lineno != 0xcdcdcdcd && (unsigned)column != 0xcdcdcdcd);
+    assertex((unsigned)lineno != 0xcccccccc && (unsigned)column != 0xcccccccc);
 #endif
     if (suppressLocationAnnotations)
         return ownedBody;
@@ -8013,7 +8013,7 @@ IHqlExpression * createJavadocAnnotation(IHqlExpression * _ownedBody, IPropertyT
 //==============================================================================================================
 
 CFileContents::CFileContents(IFile * _file, ISourcePath * _sourcePath, bool _isSigned, IHqlExpression * _gpgSignature)
-  : file(_file), sourcePath(_sourcePath), implicitlySigned(_isSigned), gpgSignature(_gpgSignature)
+  : implicitlySigned(_isSigned), file(_file), sourcePath(_sourcePath), gpgSignature(_gpgSignature)
 {
     delayedRead = false;
     if (!preloadFromFile())
@@ -8021,7 +8021,7 @@ CFileContents::CFileContents(IFile * _file, ISourcePath * _sourcePath, bool _isS
 }
 
 CFileContents::CFileContents(const char *query, ISourcePath * _sourcePath, bool _isSigned, IHqlExpression * _gpgSignature, timestamp_type _ts)
-: sourcePath(_sourcePath), implicitlySigned(_isSigned), gpgSignature(_gpgSignature), ts(_ts)
+: implicitlySigned(_isSigned), ts(_ts), sourcePath(_sourcePath), gpgSignature(_gpgSignature)
 {
     if (query)
         setContents(strlen(query), query);
@@ -8030,7 +8030,7 @@ CFileContents::CFileContents(const char *query, ISourcePath * _sourcePath, bool
 }
 
 CFileContents::CFileContents(unsigned len, const char *query, ISourcePath * _sourcePath, bool _isSigned, IHqlExpression * _gpgSignature, timestamp_type _ts)
-: sourcePath(_sourcePath), implicitlySigned(_isSigned), gpgSignature(_gpgSignature), ts(_ts)
+: implicitlySigned(_isSigned), ts(_ts), sourcePath(_sourcePath), gpgSignature(_gpgSignature)
 {
     setContents(len, query);
     delayedRead = false;
@@ -11946,7 +11946,6 @@ protected:
                 IValue * searchValue = folded->queryValue();
                 if (!searchValue)
                     break;
-                ITypeInfo * searchType = searchValue->queryType();
                 ForEachChildFrom(i, expr, 1)
                 {
                     IHqlExpression * cur = expr->queryChild(i);
@@ -12569,19 +12568,6 @@ extern IHqlExpression * createReboundFunction(IHqlExpression *func, HqlExprArray
 
 //---------------------------------------------------------------------------------------------------------------
 
-static void checkConsistent(IHqlExpression* e)
-{
-    //Check there are no datasets in the expression other than no_activetable
-    if (!e) return;
-    OwnedHqlExpr e1 = replaceSelector(e, NULL, querySelfReference());
-    OwnedHqlExpr e2 = replaceSelector(e, queryActiveTableSelector(), querySelfReference());
-    if (e1 != e2)
-    {
-        DBGLOG("Paranoia: type information wasn't correctly normalized");
-        e1.setown(replaceSelector(e, NULL, querySelfReference()));
-    }
-}
-
 //NOTE: The type information - e.g., distribution, grouping, sorting cannot include the dataset of the primary file
 //because for a no_newusertable etc. that would result in a circular reference.
 //so all references to fields in the primary file have no_activetable as the selector.
@@ -14578,11 +14564,11 @@ public:
 };
 
 static TransformTrackingInfo transformExtraState[NUM_PARALLEL_TRANSFORMS+1];
-static bool isActiveMask[NUM_PARALLEL_TRANSFORMS+1];
 
 #if NUM_PARALLEL_TRANSFORMS==1
 const unsigned threadActiveExtraIndex=1;
 #else
+static bool isActiveMask[NUM_PARALLEL_TRANSFORMS+1];
 #ifdef _WIN32
 __declspec(thread) unsigned threadActiveExtraIndex;
 #else

+ 1 - 1
ecl/hql/hqlexpr.hpp

@@ -931,7 +931,6 @@ public:
     IErrorArray orphanedWarnings;
     HqlExprArray defaultFunctionCache;
     CIArrayOf<ForwardScopeItem> forwardLinks;
-    IStatisticTarget & statsTarget;
     unsigned maxErrors = DEFAULT_MAX_ERRORS;
     bool unsuppressImmediateSyntaxErrors = false;
     bool expandCallsWhenBound;
@@ -946,6 +945,7 @@ public:
     bool ignoreCache = false;
     bool ignoreSimplified = false;
     Linked<ICodegenContextCallback> codegenCtx;
+    IStatisticTarget & statsTarget;
     CIArrayOf<FileParseMeta> metaStack;
     IEclCachedDefinitionCollection * cache = nullptr;
     hash64_t optionHash = 0;

+ 0 - 46
ecl/hql/hqlfilter.cpp

@@ -93,24 +93,6 @@ static node_operator getModifiedOp(node_operator op, bool duplicate)
     }
 }
 
-static bool isSubString(IHqlExpression * expr)
-{
-    for(;;)
-    {
-        switch (expr->getOperator())
-        {
-        case no_substring:
-            return true;
-        case no_cast:
-        case no_implicitcast:
-            break;
-        default:
-            return false;
-        }
-        expr = expr->queryChild(0);
-    }
-}
-
 static IHqlExpression * querySubStringRange(IHqlExpression * expr)
 {
     for(;;)
@@ -1031,7 +1013,6 @@ static void extendRangeCheck(SharedHqlExpr & globalGuard, SharedHqlExpr & localC
     OwnedHqlExpr len = createValue(no_charlen, LINK(unsignedType), LINK(trim));
     ITypeInfo * lengthType = lengthExpr->queryType();
     Owned<ITypeInfo> compareType = getPromotedECLCompareType(unsignedType, lengthType);
-    node_operator compOp = compareEqual ? no_le : no_gt;
     OwnedHqlExpr positiveLen = createValue(no_maxlist, lengthExpr->getType(), createValue(no_list, makeSetType(LINK(lengthType)), LINK(lengthExpr), createConstant(lengthType->castFrom(false, I64C(0)))));
     OwnedHqlExpr test = createValue(no_le, makeBoolType(), ensureExprType(len, compareType), ensureExprType(positiveLen, compareType));
     test.setown(foldHqlExpression(test));
@@ -1044,7 +1025,6 @@ static void extendRangeCheck(SharedHqlExpr & globalGuard, SharedHqlExpr & localC
 
 IHqlExpression * FilterExtractor::getRangeLimit(ITypeInfo * fieldType, IHqlExpression * lengthExpr, IHqlExpression * value, int whichBoundary)
 {
-    type_t ftc = fieldType->getTypeCode();
     unsigned fieldLength = fieldType->getStringLen();
     IValue * constValue = value->queryValue();
 
@@ -1727,32 +1707,6 @@ const char * FilterExtractor::queryKeyName(StringBuffer & s)
 }
 
 
-static bool isNextField(IHqlExpression * record, IHqlExpression * prevExpr, IHqlExpression * nextExpr)
-{
-    if ((prevExpr->getOperator() != no_select) || (nextExpr->getOperator() != no_select))
-        return false;
-    IHqlExpression * prevSelect = prevExpr->queryChild(0);
-    if (prevSelect != nextExpr->queryChild(0))
-        return false;
-    if (!containsOnlyLeft(prevExpr))
-        return false;
-    if (prevSelect->getOperator() != no_left)
-        record = prevSelect->queryRecord();
-
-    IHqlExpression * prevField = prevExpr->queryChild(1);
-    IHqlExpression * nextField = nextExpr->queryChild(1);
-
-    //Slow, but probably doesn't matter...
-    ForEachChild(i, record)
-    {
-        IHqlExpression * cur = record->queryChild(i);
-        if (cur == prevField)
-            return (record->queryChild(i+1) == nextField);
-    }
-    return false;
-}
-
-
 IHqlExpression * FilterExtractor::querySimpleJoinValue(IHqlExpression * selector)
 {
     IHqlExpression * matched = NULL;

+ 6 - 19
ecl/hql/hqlfold.cpp

@@ -547,17 +547,6 @@ static IHqlExpression * optimizeCompare(IHqlExpression * expr)
     return NULL;
 }
 
-static bool isSimpleComparisonArg(IHqlExpression * expr)
-{
-    switch (expr->getOperator())
-    {
-    case no_constant:
-    case no_getresult:
-        return true;
-    }
-    return false;
-}
-
 //---------------------------------------------------------------------------
 
 /*********************************************************
@@ -943,7 +932,7 @@ IValue * doFoldExternalCall(IHqlExpression* expr, unsigned foldOptions, ITemplat
  #ifdef _ARCH_X86_64_
         assertex((len & 15) == 0);  // We need to make sure we add an EVEN number of words to stack, so that it is 16-byte aligned before the callq
 
-        __int64 dummy1, dummy2,dummy3,dummy4;
+        __int64 dummy1, dummy3,dummy4;
 
         void * floatstack = fstack.getFloatMem(); 
         if (floatstack) { // sets xmm0-7
@@ -3393,7 +3382,6 @@ IHqlExpression * foldConstantOperator(IHqlExpression * expr, unsigned foldOption
             if (childValue)
             {
                 Linked<ITypeInfo> exprType = expr->queryType();
-                ITypeInfo * childType = child->queryType();
                 size32_t childSize = childValue->getSize();
                 const void * rawvalue = childValue->queryValue();
                 unsigned newSize = exprType->getSize();
@@ -3985,7 +3973,7 @@ IHqlExpression * foldConstantOperator(IHqlExpression * expr, unsigned foldOption
             IHqlExpression * child = expr->queryChild(0);
             node_operator childOp = child->getOperator();
             // Can't optimize count of a dictionary in general, since the input dataset may contain duplicates which will be removed.
-            switch (child->getOperator())
+            switch (childOp)
             {
             case no_null:
                 return createConstant(0);
@@ -3996,7 +3984,7 @@ IHqlExpression * foldConstantOperator(IHqlExpression * expr, unsigned foldOption
         {
             IHqlExpression * child = expr->queryChild(0);
             node_operator childOp = child->getOperator();
-            switch (child->getOperator())
+            switch (childOp)
             {
             case no_null:
                 return createConstant(false);
@@ -4578,10 +4566,10 @@ IHqlExpression * NullFolderMixin::foldNullDataset(IHqlExpression * expr)
                 return ret.getClear();
             }
 
-#if 0
             //This is pretty unlikely, and may introduce an ambiguity in LEFT (if selector sequences aren't unique)
             if (cvtRightProject && !isGrouped(expr))
             {
+#if 0
                 IHqlExpression * selSeq = querySelSeq(expr);
                 OwnedHqlExpr left = createSelector(no_left, child, selSeq);
                 OwnedHqlExpr null = createRow(no_newrow, createNullExpr(left));
@@ -4597,8 +4585,8 @@ IHqlExpression * NullFolderMixin::foldNullDataset(IHqlExpression * expr)
                 OwnedHqlExpr ret = createDataset(no_hqlproject, args);
                 DBGLOG("Folder: Replace JOIN(<empty>, ds) with PROJECT");
                 return ret.getClear();
-            }
 #endif
+            }
             break;
         }
     case no_merge:
@@ -6842,9 +6830,8 @@ HqlConstantPercolator * CExprFolderTransformer::gatherConstants(IHqlExpression *
             IHqlExpression * rhs = expr->queryChild(2);
             if (!rhs)
                 break;
-
-            //fall through
         }
+        //fallthrough
     case no_addfiles:
     case no_regroup:
     case no_nonempty:

+ 1 - 1
ecl/hql/hqlgram.hpp

@@ -1300,12 +1300,12 @@ private:
 
         Owned<IProperties> macroParms;
         IIterator *forLoop;
+        IXmlScope *xmlScope;
         IHqlExpression *macroExpr;
         Owned<IFileContents> forBody;
         Owned<IFileContents> forFilter;
         IAtom * hashDollar = nullptr;
 
-        IXmlScope *xmlScope;
 
         enum { HashStmtNone, HashStmtFor, HashStmtForAll, HashStmtLoop, HashStmtIf };
         int lastToken;

+ 1 - 3
ecl/hql/hqlgram.y

@@ -4878,7 +4878,6 @@ fieldAttr
                         }
     | DEFAULT '(' goodObject ')'
                         {
-                            IHqlExpression * arg = $3.queryExpr();
                             $$.setExpr(createExprAttribute(defaultAtom, $3.getExpr()), $1);
                         }
     | STRING_CONST
@@ -9024,7 +9023,6 @@ simpleDataSet
 
                             parser->inheritRecordMaxLength(dataset, record);
 
-                            bool hasFileposition = getBoolAttributeInList(extra, filepositionAtom, true);
                             record.setown(parser->checkIndexRecord(record, $5, extra));
 
                             parser->saveDiskAccessInformation($1, extra);
@@ -13055,7 +13053,7 @@ yybackup:
   if (yyn == YYPACT_NINF)
     goto yydefault;
 
-yyprocesschar:
+//yyprocesschar:
   yytoken = YYTRANSLATE (yychar);
 
   /* If the proper action on seeing token YYTOKEN is to reduce or to

+ 6 - 37
ecl/hql/hqlgram2.cpp

@@ -75,11 +75,6 @@ static void setAttribute(int attrToken)
     attributeToTokenMap[attrToken] = attrToken;
 }
 
-static void setKeyword(int attrToken)
-{
-    attributeToTokenMap[attrToken] = attrToken;
-}
-
 //called if the attribute is clashes with another reserved word
 static void setAttribute(int attrToken, int lexToken)
 {
@@ -1149,7 +1144,6 @@ IHqlExpression * HqlGram::processIndexBuild(const attribute &err, attribute & in
         }
 
         //Recalculated because it might be updated in modifyIndexPayloadRecord() above
-        bool hasFileposition = getBoolAttributeInList(flags, filepositionAtom, true);
         record.setown(checkBuildIndexRecord(record.getClear(), *recordAttr));
         record.setown(checkIndexRecord(record, *recordAttr, flags));
         projectedDataset.setown(createDataset(no_selectfields, { LINK(dataset), LINK(record) }));
@@ -1442,7 +1436,7 @@ class SelfReferenceReplacer : public QuickHqlTransformer, public CInterface
 {
 public:
     SelfReferenceReplacer(HqlGram * _parser, IHqlExpression * _self)
-    : QuickHqlTransformer(selfReferenceReplacerInfo, nullptr), parser(_parser), self(_self)
+    : QuickHqlTransformer(selfReferenceReplacerInfo, nullptr), self(_self), parser(_parser)
     {
     }
 
@@ -6147,7 +6141,7 @@ IHqlExpression * HqlGram::processSortList(const attribute & errpos, node_operato
                     if (attr == prefetchAtom) ok = true;
                     if (attr == mergeAtom) ok = true;
                     if (attr == groupedAtom) ok = true;
-                    /* no break */
+                    //fallthrough
                 case no_group:
                     if (attr == allAtom) ok = true;
                     if (attr == localAtom) ok = true;
@@ -6160,7 +6154,7 @@ IHqlExpression * HqlGram::processSortList(const attribute & errpos, node_operato
                     break;
                 case no_topn:
                     if (attr == bestAtom) ok = true;
-                    /* no break */
+                    //fallthrough
                 case no_sort:
                     if (attr == localAtom) ok = true;
                     if (attr == skewAtom) ok = true;
@@ -6176,7 +6170,7 @@ IHqlExpression * HqlGram::processSortList(const attribute & errpos, node_operato
                 case no_mergejoin:
                     if (attr == dedupAtom) ok = true;
                     if (attr == assertAtom) ok = true;
-                    /* no break */
+                    //fallthrough
                 case no_nwayjoin:
                     if (attr == localAtom) ok = true;
                     if (attr == mofnAtom) ok = true;
@@ -6856,8 +6850,8 @@ IHqlExpression * HqlGram::checkParameter(const attribute * errpos, IHqlExpressio
             IHqlExpression * record = formal->queryRecord();
             if (record->numChildren() == 0)
                 break;
-            // fallthrough
         }
+        // fallthrough
     default:
         if (formalTC == type_row)
             formalType = formalType->queryChildType();
@@ -8255,29 +8249,6 @@ bool HqlGram::isExplicitlyDistributed(IHqlExpression *e)
     return false;
 }
 
-static bool isFromFile(IHqlExpression * expr)
-{
-    for (;;)
-    {
-        switch (expr->getOperator())
-        {
-        case no_table:
-            return true;
-        case no_usertable:
-            if (isAggregateDataset(expr))
-                return false;
-            //fallthrough...
-        case no_filter:
-        case no_hqlproject:
-            expr = expr->queryChild(0);
-            break;
-        default:
-            return false;
-        }
-    }
-}
-
-
 static const char * getName(IHqlExpression * e)
 {
     if (e->queryName())
@@ -8354,7 +8325,6 @@ void HqlGram::checkJoinFlags(const attribute &err, IHqlExpression * join)
     bool lonly = join->hasAttribute(leftonlyAtom);
     bool ronly = join->hasAttribute(rightonlyAtom);
     bool fonly = join->hasAttribute(fullonlyAtom);
-    bool lo = join->hasAttribute(leftouterAtom) || lonly;
     bool ro = join->hasAttribute(rightouterAtom) || ronly;
     bool fo = join->hasAttribute(fullouterAtom) || fonly;
     bool keep = join->hasAttribute(keepAtom);
@@ -10049,7 +10019,6 @@ IHqlExpression * HqlGram::normalizeFunctionExpression(const attribute &idattr, D
 
 void HqlGram::defineSymbolInScope(IHqlScope * scope, DefineIdSt * defineid, IHqlExpression * expr, const attribute & idattr, int assignPos, int semiColonPos)
 {
-    IHqlScope * exprScope = expr->queryScope();
     IHqlExpression * scopeExpr = queryExpression(scope);
     IIdAtom * moduleName = nullptr;
     if (!inType)
@@ -11926,8 +11895,8 @@ void HqlGram::syntaxError(const char *s, int token, int *expected)
                 return;
             }
         }
-        // fall into...
     }
+        //fallthrough
     
     default:
         msg.append(s);

+ 14 - 14
ecl/hql/hqlir.cpp

@@ -791,13 +791,13 @@ public:
 struct SimpleTypeBuilderInfo
 {
 public:
-    SimpleTypeBuilderInfo() : length(0), isSigned(false), precision(0), locale(NULL) {}
+    SimpleTypeBuilderInfo() {}
 
 public:
-    size32_t length;
-    size32_t precision;
-    bool isSigned;
-    const char * locale; // locale or code page
+    size32_t length = 0;
+    size32_t precision = 0;
+    bool isSigned = false;
+    const char * locale = nullptr; // locale or code page
 };
 
 struct CompoundTypeBuilderInfo
@@ -839,16 +839,16 @@ public:
 class ExprAnnotationBuilderInfo
 {
 public:
-    ExprAnnotationBuilderInfo() : expr(0), name(NULL), value(0), line(0), col(0), warning(NULL), tree(NULL) {}
+    ExprAnnotationBuilderInfo() {}
 
 public:
-    exprid_t expr;
-    const char * name;
-    IError * warning;
-    IPropertyTree * tree;
-    unsigned value;
-    unsigned line;
-    unsigned col;
+    exprid_t expr = 0;
+    const char * name = nullptr;
+    IError * warning = nullptr;
+    IPropertyTree * tree = nullptr;
+    unsigned value = 0;
+    unsigned line = 0;
+    unsigned col = 0;
     IdArray args;
 };
 
@@ -2114,7 +2114,7 @@ id_t ExpressionIRPlayer::doProcessAnnotation(IHqlExpression * expr)
         {
             IHqlNamedAnnotation * annotation = static_cast<IHqlNamedAnnotation *>(expr->queryAnnotation());
             info.name = str(expr->queryId());
-            info.value = annotation->isExported() ? ob_exported : annotation->isShared() ? ob_shared : 0;
+            info.value = annotation->isExported() ? ob_exported : annotation->isShared() ? ob_shared : ob_private;
             if (annotation->isVirtual())
                 info.value |= ob_virtual;
             info.line = expr->getStartLine();

+ 4 - 2
ecl/hql/hqlopt.cpp

@@ -1999,6 +1999,7 @@ bool CTreeOptimizer::isWorthMovingProjectOverLimit(IHqlExpression * project)
         case no_join:
             if (isKeyedJoin(expr))
                 return false;
+            return true;
         case no_selfjoin:
         case no_fetch:
         case no_normalize:
@@ -2010,7 +2011,7 @@ bool CTreeOptimizer::isWorthMovingProjectOverLimit(IHqlExpression * project)
         case no_newusertable:
             if (isAggregateDataset(expr))
                 return false;
-            //fallthrough.
+            //fallthrough
         case no_hqlproject:
             if (!isPureActivity(expr) || expr->hasAttribute(_countProject_Atom) || expr->hasAttribute(prefetchAtom))
                 return false;
@@ -2453,8 +2454,8 @@ IHqlExpression * CTreeOptimizer::doCreateTransformed(IHqlExpression * transforme
             IHqlExpression * counterAttr = transformed->queryAttribute(_countProject_Atom);
             if (counterAttr && !transformContainsCounter(transformed->queryChild(1), counterAttr->queryChild(0)))
                 return removeAttribute(transformed, _countProject_Atom);
-            //fallthrough
         }
+        //fallthrough
     case no_newusertable:
         if (transformed->hasAttribute(keyedAtom))
         {
@@ -3408,6 +3409,7 @@ IHqlExpression * CTreeOptimizer::doCreateTransformed(IHqlExpression * transforme
             case no_newusertable:
                 if (isAggregateDataset(child))
                     break;
+                //fallthrough
             case no_hqlproject:
                 {
                     if (!isPureActivityIgnoringSkip(child) || hasUnknownTransform(child))

+ 4 - 8
ecl/hql/hqlparse.cpp

@@ -86,8 +86,8 @@ class CTemplateContext : implements ITemplateContext, public CInterface
 {
     HqlLex * lexer;
     IXmlScope* m_xmlScope;
-    int m_startLine,m_startCol;
     HqlLookupContext & m_lookupContext;
+    int m_startLine,m_startCol;
 
 public:
     IMPLEMENT_IINTERFACE;
@@ -163,7 +163,7 @@ public:
 // ===================================== HqlLex ============================================
 
 HqlLex::HqlLex(HqlGram *parser, IFileContents * contents, IXmlScope *_xmlScope, IHqlExpression *_macroExpr)
- : yyParser(parser), xmlScope(LINK(_xmlScope)), macroExpr(_macroExpr), sourcePath(contents->querySourcePath())
+ : yyParser(parser), sourcePath(contents->querySourcePath()), xmlScope(LINK(_xmlScope)), macroExpr(_macroExpr)
 {
     assertex(parser);
     init(contents);
@@ -696,7 +696,7 @@ bool HqlLex::getParameter(StringBuffer &curParam, const char* for_what, int* sta
         case ')':
             if (parenDepth==1)
                 return false;
-            // fall into
+            // fallthrough
         case ']':
             parenDepth--;
             curParam.append((char) tok);
@@ -968,7 +968,6 @@ void HqlLex::doLine(attribute & returnToken)
     int line = returnToken.pos.lineno, col = returnToken.pos.column;
     forwhat.appendf("LINE(%d,%d)",returnToken.pos.lineno,returnToken.pos.column);
 
-    IIdAtom * name = NULL;
     if (yyLex(returnToken, LEXnone, 0) != '(')
     {
         reportError(returnToken, ERR_EXPECTED_LEFTCURLY, "( expected");
@@ -1080,7 +1079,6 @@ void HqlLex::doError(attribute & returnToken, bool isError)
     StringBuffer forwhat;
     forwhat.appendf("%s(%d,%d)",isError?"#ERROR":"#WARNING",returnToken.pos.lineno,returnToken.pos.column);
 
-    IIdAtom * name = NULL;
     if (yyLex(returnToken, LEXnone, 0) != '(')
     {
         reportError(returnToken, ERR_EXPECTED_LEFTCURLY, "( expected");
@@ -1186,7 +1184,6 @@ void HqlLex::doTrace(attribute & returnToken)
     StringBuffer forwhat;
     forwhat.appendf("#TRACE(%d,%d)",returnToken.pos.lineno,returnToken.pos.column);
 
-    IIdAtom * name = NULL;
     if (yyLex(returnToken, LEXnone, 0) != '(')
     {
         reportError(returnToken, ERR_EXPECTED_LEFTCURLY, "( expected");
@@ -1675,7 +1672,7 @@ void HqlLex::doPreprocessorLookup(const attribute & errpos, bool stringify, int
             case '\\':
             case '\'':
                 *s++='\\';
-                // fall into
+                // fallthrough
             default:
                 *s++=c;
             }
@@ -2165,7 +2162,6 @@ int HqlLex::processStringLiteral(attribute & returnToken, char *CUR_TOKEN_TEXT,
         }
         else if (next >= 128)
         {
-            const byte * temp = (byte *)finger;
             unsigned lenLeft = CUR_TOKEN_LENGTH - (size32_t)(finger - CUR_TOKEN_TEXT);
             int extraCharsRead = rtlSingleUtf8ToCodepage(bf, lenLeft, finger, ASCII_LIKE_CODEPAGE);
             if (extraCharsRead == -1)

+ 1 - 1
ecl/hql/hqlpmap.cpp

@@ -1162,8 +1162,8 @@ protected:
     void checkMatch(IHqlExpression * select);
 
 protected:
-    LinkedHqlExpr selector;
     HqlExprCopyArray & selects;
+    LinkedHqlExpr selector;
 };
 
 

+ 0 - 15
ecl/hql/hqlscope.cpp

@@ -26,21 +26,6 @@
 #include "hqlthql.hpp"
 #include "hqlerror.hpp"
 
-static void getECL(IHqlExpression * expr, StringBuffer & s)
-{
-    toUserECL(s, expr, false);
-    if (s.length() > 2)
-        s.setLength(s.length()-2);
-}
-
-static const char * queryName(StringBuffer & s, IHqlExpression * expr)
-{
-    if (expr->queryName())
-        return s.append(expr->queryName()).str();
-    getECL(expr, s);
-    return s.str();
-}
-
 //---------------------------------------------------------------------------
 
 void ScopeCheckerBase::analyseExpr(IHqlExpression * expr)

+ 3 - 5
ecl/hql/hqlthql.cpp

@@ -1156,7 +1156,7 @@ void HqltHql::toECL(IHqlExpression *expr, StringBuffer &s, bool paren, bool inTy
                 s.append("RECORD");
                 indent++;
             }
-            bool hadAttr = false;
+
             //Slightly weird.  no_record inside a record imply inheritance, and have a slightly different syntax.
             //Should probably be expanded when the graph is normalized...
             ForEachChild(i2, expr)
@@ -1170,7 +1170,6 @@ void HqltHql::toECL(IHqlExpression *expr, StringBuffer &s, bool paren, bool inTy
                     else
                         createPseudoSymbol(s, "record__", child);
                     s.append(")");
-                    hadAttr = true;
                 }
             }
                 
@@ -1181,7 +1180,6 @@ void HqltHql::toECL(IHqlExpression *expr, StringBuffer &s, bool paren, bool inTy
                 {
                     s.append(",");
                     toECL(child, s, false, inType, 0);
-                    hadAttr = true;
                 }
             }
             if (!fieldsInline)
@@ -2674,8 +2672,8 @@ void HqltHql::toECL(IHqlExpression *expr, StringBuffer &s, bool paren, bool inTy
                         toECL(expr->queryChild(i), s, false, inType);
                     }
                     s.append(")");
-                    break;
                 }
+                break;
             }
         case no_sequence:
             if (expr->queryName())
@@ -3571,7 +3569,7 @@ StringBuffer &expandDotLiteral(StringBuffer &s, const char *f)
         case '\"':
         case '\'':
             s.append('\\');
-            // fall into...
+            // fallthrough
         default:
             if (chars++ > 1000)
                 return s;

+ 5 - 2
ecl/hql/hqltrans.cpp

@@ -37,8 +37,10 @@
  //#define TRACE_DEEP_SCOPES
 #endif
 
+#ifdef OPTIMIZE_TRANSFORM_ALLOCATOR
 static unsigned transformerDepth;
 static CLargeMemoryAllocator * transformerHeap;
+#endif
 
 #define ALLOCATOR_MIN_PAGES     10
 
@@ -920,6 +922,7 @@ IHqlExpression * QuickHqlTransformer::createTransformedBody(IHqlExpression * exp
     case no_getresult:
         if (!expr->queryRecord())
             break;
+        //fallthrough
     case no_newtransform:
     case no_transform:
     case no_rowsetrange:
@@ -1326,7 +1329,7 @@ void NewHqlTransformer::analyseExpr(IHqlExpression * expr)
         {
             IHqlExpression * ds = expr->queryChild(0);
 #ifdef _DEBUG
-            IHqlExpression * field = expr->queryChild(1);
+            IHqlExpression * field __attribute__((unused)) = expr->queryChild(1);  // to simplify viewing in a debugger
 #endif
             if (isNewSelector(expr))
                 analyseExpr(ds);
@@ -4763,7 +4766,7 @@ void SplitterVerifier::analyseExpr(IHqlExpression * expr)
         {
 #ifdef _DEBUG
             IHqlExpression * id = expr->queryAttribute(_uid_Atom);
-            unsigned idValue = (id ? (unsigned)getIntValue(id->queryChild(0)) : 0);
+            unsigned idValue __attribute__((unused)) = (id ? (unsigned)getIntValue(id->queryChild(0)) : 0);  // to simplify viewing in a debugger
 #endif
             unsigned splitSize = (unsigned)getIntValue(expr->queryChild(1), 0);
             if (extra->useCount > splitSize)

+ 0 - 2
ecl/hql/hqlusage.cpp

@@ -457,7 +457,6 @@ IPropertyTree * SourceFieldUsage::createReport(bool includeFieldDetail, const IP
 
 void SourceFieldUsage::expandSelects(IPropertyTree * xml, IHqlExpression * record, IHqlExpression * selector, bool allUsed, bool includeFieldDetail, unsigned & numFields, unsigned & numFieldsUsed) const
 {
-    bool seenAll = true;
     ForEachChild(i, record)
     {
         IHqlExpression * cur = record->queryChild(i);
@@ -484,7 +483,6 @@ void SourceFieldUsage::expandSelects(IPropertyTree * xml, IHqlExpression * recor
                     {
                         //could have an option to output unused fields, with code like the following:
                         //addSelect(xml, selected, thisUsed);
-                        seenAll = false;
                     }
                 }
                 break;

+ 1 - 9
ecl/hql/hqlutil.cpp

@@ -67,13 +67,6 @@ static IHqlExpression * cachedLocalSequenceNumber;
 static IHqlExpression * cachedStoredSequenceNumber;
 static IHqlExpression * cachedOmittedValueExpr;
 
-static void initBoolAttr(IAtom * name, IHqlExpression * x[2])
-{
-    x[0] = createExprAttribute(name, createConstant(false));
-    x[1] = createExprAttribute(name, createConstant(true));
-}
-
-
 MODULE_INIT(INIT_PRIORITY_STANDARD)
 {
     sizetType = makeIntType(sizeof(size32_t), false);
@@ -1688,8 +1681,8 @@ DedupInfoExtractor::DedupInfoExtractor(IHqlExpression * expr)
                     equalities.append(*mapped.getClear());
                     break;
                 }
-                //fall through
             }
+            //fallthrough
         default:
             if (containsSelector(cur, left) || containsSelector(cur, right))
                 conds.append(*LINK(cur));
@@ -3628,7 +3621,6 @@ bool isValidXmlRecord(IHqlExpression * expr)
 static void expandHintValue(StringBuffer & s, IHqlExpression * expr)
 {
     node_operator op = expr->getOperator();
-    node_operator childOp = no_none;
     switch (op)
     {
     case no_constant:

+ 1 - 1
ecl/hql/hqlutil.hpp

@@ -875,9 +875,9 @@ public:
     bool conditionAllEqualities;
 protected:
     //The expression is assumed to outlast this class instance => doesn't used linked
-    IHqlExpression * cond;
     IHqlExpression * lhs;
     IHqlExpression * rhs;
+    IHqlExpression * cond;
     IHqlExpression * seq;
     IHqlExpression * atmostAttr;
     LinkedHqlExpr left;

+ 0 - 14
ecl/hql/hqlwuerr.cpp

@@ -18,20 +18,6 @@
 #include "hqlwuerr.hpp"
 
 
-static void formatError(StringBuffer & out, int errNo, const char *msg, IIdAtom * modulename, IIdAtom * attributename, int lineno, int column)
-{
-    out.append(str(modulename));
-    if (attributename)
-        out.append('.').append(str(attributename));
-    
-    if(lineno && column)
-        out.append('(').append(lineno).append(',').append(column).append(')');
-    out.append(" : ");
-
-    out.append(errNo).append(": ").append(msg);
-}
-
-
 class CompoundErrorReceiver : implements IErrorReceiver, public CInterface
 {
 public:

+ 5 - 0
ecl/hqlcpp/CMakeLists.txt

@@ -127,6 +127,11 @@ IF (NOT WIN32)
   include_directories(${BINUTILS_INCLUDE_DIR})
 ENDIF()
 
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
+  #implicit-fallthrough is currently disabled because it does not seem to process noreturn attributes on a virtual function correctly (throwStringExceptionV)
+  SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-switch -Wno-unused-parameter -Werror -Wno-error=delete-non-virtual-dtor -Wimplicit-fallthrough=0")
+endif()
+
 ADD_DEFINITIONS( -DHQLCPP_EXPORTS -D_USRDLL )
 
 HPCC_ADD_LIBRARY( hqlcpp SHARED ${SRCS} )

+ 1 - 1
ecl/hqlcpp/hqlcfilter.hpp

@@ -56,7 +56,7 @@ struct BuildFilterState
 };
 
 
-class CppFilterExtractor : public FilterExtractor
+class CppFilterExtractor final : public FilterExtractor
 {
 public:
     CppFilterExtractor(IHqlExpression * _tableExpr, HqlCppTranslator & _translator, int _numKeyableFields, bool isDiskRead, bool forceValueSets);

+ 0 - 1
ecl/hqlcpp/hqlckey.cpp

@@ -1038,7 +1038,6 @@ bool KeyedJoinInfo::processFilter()
 
     //Now need to transform the index into its real representation so
     //the hozed transforms take place.
-    unsigned payload = numPayloadFields(key);
     TableProjectMapper mapper(expandedKey);
     OwnedHqlExpr rightSelect = createSelector(no_right, key, joinSeq);
     OwnedHqlExpr newFilter = mapper.expandFields(keyedKeyFilter, rightSelect, rawKey, rawKey);

+ 5 - 4
ecl/hqlcpp/hqlcpp.cpp

@@ -140,7 +140,7 @@ void SubStringInfo::bindToFrom(HqlCppTranslator & translator, BuildCtx & ctx)
 
 //---------------------------------------------------------------------------
 
-WorkflowItem::WorkflowItem(IHqlExpression * _function) : wfid(999999999), function(_function), workflowOp(no_funcdef)
+WorkflowItem::WorkflowItem(IHqlExpression * _function) : wfid(999999999), workflowOp(no_funcdef), function(_function)
 {
     IHqlExpression * body = function->queryChild(0);
     assertex(body->getOperator() == no_outofline);
@@ -495,6 +495,7 @@ bool canRemoveStringCast(ITypeInfo * to, ITypeInfo * from)
                 //Data never calls a conversion function...
                 if ((srcset == tgtset) || (to->getTypeCode() == type_data) || (from->getTypeCode() == type_data))
                     return true;
+                return false;
             }
         case type_qstring:
             return false;
@@ -1546,7 +1547,6 @@ void HqlCppTranslator::cacheOptions()
 
     //Some compound flags, which provide defaults for various other options.
     bool paranoid = getDebugFlag("paranoid", false);
-    bool releaseMode = getDebugFlag("release", true);
 
     struct DebugOption 
     {
@@ -2299,7 +2299,7 @@ void HqlCppTranslator::exportMappings(IWorkUnit * wu) const
     errorProcessor->exportMappings(wu);
 }
 
-void HqlCppTranslator::ThrowStringException(int code,const char *format, ...) const
+void HqlCppTranslator::throwStringExceptionV(int code,const char *format, ...) const
 {
     IHqlExpression * location = queryActiveActivityLocation();
     if (errorProcessor && location)
@@ -10785,8 +10785,8 @@ void HqlCppTranslator::assignAndCast(BuildCtx & ctx, const CHqlBoundTarget & tar
                     callProcedure(ctx, strToQStrId, args);
                     break;
                 }
-                //fall through
             }
+            // fallthrough
         default:
             //Need to go via a temporary string.
             OwnedHqlExpr temp = pure.getTranslatedExpr();
@@ -11943,6 +11943,7 @@ void HqlCppTranslator::doBuildUserFunctionReturn(BuildCtx & ctx, ITypeInfo * typ
             doBuildUserFunctionReturn(subctx, type, branches->queryChild(1));
             break;
         }
+        // fallthrough
     default:
         {
             OwnedHqlExpr optimized = spotScalarCSE(value, NULL, queryOptions().spotCseInIfDatasetConditions);

+ 3 - 3
ecl/hqlcpp/hqlcpp.ipp

@@ -513,12 +513,12 @@ public:
     const char * queryGraphLabel() const { return label ? label.str() : nullptr; }
 
 private:
+    unsigned wfid;
+    node_operator workflowOp;
     LinkedHqlExpr function;
     HqlExprArray exprs;
     UnsignedArray dependencies;
-    unsigned wfid;
     StringBuffer label;
-    node_operator workflowOp;
 };
 
 typedef CIArrayOf<WorkflowItem> WorkflowArray;
@@ -909,7 +909,7 @@ public:
     virtual size32_t errCount() override;
     virtual size32_t warnCount() override;
     virtual void exportMappings(IWorkUnit * wu) const override;
-    virtual __declspec(noreturn) void ThrowStringException(int code,const char *format, ...) const override __attribute__((format(printf, 3, 4), noreturn));            // override the global function to try and add more context information
+    virtual __declspec(noreturn) void throwStringExceptionV(int code,const char *format, ...) const override __attribute__((format(printf, 3, 4), noreturn));            // override the global function to try and add more context information
 
 //Statements.
     void buildStmt(BuildCtx & ctx, IHqlExpression * expr);

+ 6 - 7
ecl/hqlcpp/hqlcppds.cpp

@@ -564,7 +564,6 @@ IReferenceSelector * HqlCppTranslator::buildNewRow(BuildCtx & ctx, IHqlExpressio
     case no_matchrow:
         return doBuildRowMatchRow(ctx, expr, true);
     case no_getgraphresult:
-    {
         if (expr->hasAttribute(externalAtom))
         {
             OwnedHqlExpr translated = translateGetGraphResult(ctx, expr);
@@ -574,8 +573,7 @@ IReferenceSelector * HqlCppTranslator::buildNewRow(BuildCtx & ctx, IHqlExpressio
             bindRow(ctx, expr, boundRow->queryBound());
             return selector.getClear();
         }
-        //fall through
-    }
+        // fallthrough
     case no_call:
     case no_externalcall:
     case no_alias:
@@ -607,7 +605,7 @@ IReferenceSelector * HqlCppTranslator::buildNewRow(BuildCtx & ctx, IHqlExpressio
     case no_select:
         {
 #ifdef _DEBUG
-            IHqlExpression * field = expr->queryChild(1);
+            IHqlExpression * field __attribute__((unused)) = expr->queryChild(1); // to simplify viewing in a debugger
 #endif
             Owned<IReferenceSelector> selector;
             if (isNewSelector(expr))
@@ -701,7 +699,7 @@ IReferenceSelector * HqlCppTranslator::buildActiveRow(BuildCtx & ctx, IHqlExpres
     case no_select:
         {
 #ifdef _DEBUG
-            IHqlExpression * field = expr->queryChild(1);
+            IHqlExpression * field __attribute__((unused)) = expr->queryChild(1); // to simplify viewing in a debugger
 #endif
             Owned<IReferenceSelector> selector = buildNewOrActiveRow(ctx, expr->queryChild(0), isNewSelector(expr));
             return selector->select(ctx, expr);
@@ -1875,7 +1873,6 @@ IHqlExpression * HqlCppTranslator::getResourcedChildGraph(BuildCtx & ctx, IHqlEx
     gatherActiveCursors(ctx, activeRows);
     if (graphKind == no_loop)
     {
-        bool insideChild = insideChildQuery(ctx);
         resourced.setown(resourceLoopGraph(*this, activeRows, resourced, targetClusterType, graphIdExpr, numResults, isInsideChildQuery, unlimitedResources));
     }
     else
@@ -2533,6 +2530,7 @@ void HqlCppTranslator::doBuildDataset(BuildCtx & ctx, IHqlExpression * expr, CHq
 //---------------------------------------------------------------------------
 // Dataset assignment - to temp
 
+#if 0 // calling code is currently commented out
 static bool isWorthAssigningDirectly(BuildCtx & ctx, const CHqlBoundTarget & /*target*/, IHqlExpression * expr)
 {
     //target parameter is currently unused - it should be used to check that linkcounted attributes match etc.
@@ -2541,6 +2539,7 @@ static bool isWorthAssigningDirectly(BuildCtx & ctx, const CHqlBoundTarget & /*t
     //A poor approximation.  Could also include function calls if the is-link-counted matches.
     return ::canEvaluateInline(&ctx, expr);
 }
+#endif
 
 void HqlCppTranslator::buildDatasetAssign(BuildCtx & ctx, const CHqlBoundTarget & target, IHqlExpression * expr)
 {
@@ -3325,7 +3324,6 @@ void HqlCppTranslator::buildDatasetAssignInlineTable(BuildCtx & ctx, IHqlCppData
 
     unsigned maxRows = transforms->numChildren();
     unsigned row;
-    const bool copyConstantRows = true;//getFieldCount(expr->queryRecord()) > 2;
     for (row = 0; row < maxRows; row++)
     {
         IHqlExpression * transform = transforms->queryChild(row);
@@ -3498,6 +3496,7 @@ void HqlCppTranslator::buildDatasetAssignProject(BuildCtx & ctx, IHqlCppDatasetB
         }
 
         target->finishRow(iterctx, targetRow);
+        iterctx.removeAssociation(skipAssociation);     //remove it in case keeping hold of it causes issues.
     }
 }
 

+ 1 - 1
ecl/hqlcpp/hqlcse.cpp

@@ -750,7 +750,7 @@ void CseScopeInfo::calcCommonLocation()
     {
         CseScopeInfo *firstParentExtra = firstParent;
         parent = firstParentExtra;
-        CseScopeInfo * parentPath = parent ? parent->queryValidPath() : nullptr;
+        //CseScopeInfo * parentPath = parent ? parent->queryValidPath() : nullptr;
         moved = firstParent->hasMoved();
         ForEachItemIn(i, parents)
         {

+ 0 - 2
ecl/hqlcpp/hqlecl.cpp

@@ -440,7 +440,6 @@ bool HqlDllGenerator::generateCode(HqlQueryContext & query)
             return generateFullFieldUsageStatistics(translator, query.expr);
         }
 
-        bool ok = false;
         try
         {
             if (!translator.buildCpp(*code, query))
@@ -535,7 +534,6 @@ void HqlDllGenerator::doExpand(HqlCppTranslator & translator)
     CCycleTimer elapsedTimer;
     addTimeStamp(wu, SSTcompilestage, "compile:write c++", StWhenStarted);
 
-    unsigned numExtraFiles = translator.getNumExtraCppFiles();
     bool isMultiFile = translator.spanMultipleCppFiles();
     CompilerType targetCompiler = translator.queryOptions().targetCompiler;
 

+ 1 - 1
ecl/hqlcpp/hqlhoist.hpp

@@ -26,7 +26,7 @@ class CHqlExprGuard : public CInterface
 {
 public:
     CHqlExprGuard(IHqlExpression * _guard, IHqlExpression * _original, bool _guardContainsCandidate)
-        : guard(_guard), original(_original), guardContainsCandidate(_guardContainsCandidate)
+        : guardContainsCandidate(_guardContainsCandidate), guard(_guard), original(_original)
     {
     }
 

+ 10 - 42
ecl/hqlcpp/hqlhtcpp.cpp

@@ -1692,7 +1692,7 @@ void MetaInstance::setMeta(HqlCppTranslator & translator, IHqlExpression * _reco
 unsigned LocationArray::findLocation(IHqlExpression * location)
 {
     ISourcePath * sourcePath = location->querySourcePath();
-    unsigned line = location->getStartLine();
+    int line = location->getStartLine();
     ForEachItem(i)
     {
         IHqlExpression & cur = item(i);
@@ -1720,7 +1720,7 @@ enum { createPrio = 1000, inputPrio = 3000, readyPrio = 4000, goPrio = 5000, don
 
 ActivityInstance::ActivityInstance(HqlCppTranslator & _translator, BuildCtx & ctx, ThorActivityKind _kind, IHqlExpression * _dataset, const char * _activityArgName) :
     HqlExprAssociation(activeActivityMarkerExpr),
-    translator(_translator), classctx(ctx), startctx(ctx), createctx(ctx), nestedctx(ctx), onstartctx(ctx), numChildQueries(0)
+    translator(_translator), classctx(ctx), createctx(ctx), startctx(ctx), nestedctx(ctx), onstartctx(ctx)
 {
     activityExpr.set(_dataset);
     kind = _kind;
@@ -2563,7 +2563,7 @@ StringBuffer &expandLiteral(StringBuffer &s, const char *f)
         case '\"':
         case '\'':
             s.append('\\');
-            // fall into...
+            // fallthrough
         default:
             s.append(c);
             break;
@@ -2936,7 +2936,7 @@ void initBoundStringTarget(CHqlBoundTarget & target, ITypeInfo * type, const cha
 //---------------------------------------------------------------------------
 
 GlobalClassBuilder::GlobalClassBuilder(HqlCppTranslator & _translator, BuildCtx & _ctx, const char * _className, const char * _baseName, const char * _accessorInterface, bool _hasCodeContext, bool _createIsVirtual)
-: translator(_translator), classctx(_ctx), nestedctx(_ctx), startctx(_ctx), createctx(_ctx), hasCodeContext(_hasCodeContext), createIsVirtual(_createIsVirtual)
+: translator(_translator), classctx(_ctx), nestedctx(_ctx), createctx(_ctx), startctx(_ctx), hasCodeContext(_hasCodeContext), createIsVirtual(_createIsVirtual)
 {
     className.set(_className);
     baseName.set(_baseName);
@@ -3640,7 +3640,6 @@ bool HqlCppTranslator::buildMetaPrefetcherClass(BuildCtx & ctx, IHqlExpression *
     prefetcher.buildClass(RowMetaPrio);
     prefetcher.setIncomplete(true);
 
-    BuildCtx & classctx = prefetcher.classctx;
     OwnedHqlExpr dataset = createDataset(no_null, LINK(record));
     bool ok;
     {
@@ -3652,7 +3651,6 @@ bool HqlCppTranslator::buildMetaPrefetcherClass(BuildCtx & ctx, IHqlExpression *
         ok = queryRecordOffsetMap(record, false)->buildReadAhead(*this, func.ctx, selector, helper);
     }
 
-
     if (ok)
     {
         prefetcher.setIncomplete(false);
@@ -3693,7 +3691,6 @@ IHqlExpression * HqlCppTranslator::getRtlFieldKey(IHqlExpression * expr, IHqlExp
         {
         case type_bitfield:
             {
-                AColumnInfo * root = map->queryRootColumn();
                 CBitfieldInfo * resolved = static_cast<CBitfieldInfo *>(columnInfo);
                 assertex(resolved);
                 unsigned offset = resolved->queryBitfieldOffset();
@@ -3914,7 +3911,6 @@ unsigned HqlCppTranslator::buildRtlIfBlockField(StringBuffer & instanceName, IHq
     //First generate a pseudo type entry for an ifblock.
     unsigned fieldType = type_ifblock|RFTMunknownsize;
     {
-        unsigned length = 0;
         StringBuffer childTypeName;
         unsigned childType = buildRtlRecordFields(childTypeName, ifblock->queryChild(1), rowRecord, rowTypeName);
         fieldType |= (childType & RFTMinherited);
@@ -6409,6 +6405,7 @@ IReferenceSelector * HqlCppTranslator::buildReference(BuildCtx & ctx, IHqlExpres
 #ifdef _DEBUG
             //Here to make tracing easier in a debugger
             IHqlExpression * field = expr->queryChild(1);
+            assertex(field);
 #endif
             Owned<IReferenceSelector> selector;
             if (isNewSelector(expr))
@@ -7270,7 +7267,6 @@ BoundRow * HqlCppTranslator::bindTableCursorOrRow(BuildCtx & ctx, IHqlExpression
 
 BoundRow * HqlCppTranslator::createBoundRow(IHqlExpression * dataset, IHqlExpression * bound)
 {
-    bool useAccessor = false;
     IHqlExpression * accessor = NULL;
     return new BoundRow(dataset->queryBody(), bound, accessor, queryRecordOffsetMap(dataset->queryRecord(), (accessor != NULL)));
 }
@@ -7960,30 +7956,6 @@ void HqlCppTranslator::doBuildStmtSetResult(BuildCtx & ctx, IHqlExpression * exp
         popCluster(subctx);
 }
 
-static bool isFilePersist(IHqlExpression * expr)
-{
-    for (;;)
-    {
-        switch (expr->getOperator())
-        {
-        case no_thor:
-            expr = expr->queryChild(0);
-            break;
-        case no_compound:
-            expr = expr->queryChild(1);
-            break;
-        case no_output:
-            return isFileOutput(expr);
-        case no_actionlist:
-        case no_orderedactionlist:
-            expr = expr->queryChild(expr->numChildren()-1);
-            break;
-        default:
-            return false;
-        }
-    }
-}
-
 IHqlExpression * HqlCppTranslator::calculatePersistInputCrc(BuildCtx & ctx, IHqlExpression * expr)
 {
     DependenciesUsed dependencies(true);
@@ -9724,7 +9696,6 @@ void HqlCppTranslator::doBuildThorGraph(BuildCtx & ctx, IHqlExpression * expr)
     {
         beginGraph();
 
-        unsigned id = 0;
         OwnedHqlExpr graphTag = createAttribute(graphAtom, createUniqueId());
         OwnedHqlExpr resourced = getResourcedGraph(expr->queryChild(0), graphTag);
         if (resourced)
@@ -11109,7 +11080,7 @@ void HqlCppTranslator::addSchemaField(IHqlExpression *field, MemoryBuffer &schem
         break;
     case type_bitfield:
         schemaType.set(schemaType->queryPromotedType());
-        //fall through;
+        // fallthrough
     case type_dictionary:
     case type_table:
     case type_groupedtable:
@@ -11732,7 +11703,6 @@ ABoundActivity * HqlCppTranslator::doBuildActivityDictionaryWorkunitWrite(BuildC
     IHqlExpression * dictionary = expr->queryChild(0);
     IHqlExpression * seq = querySequence(expr);
     IHqlExpression * name = queryResultName(expr);
-    int sequence = (int)getIntValue(seq, ResultSequenceInternal);
 
     OwnedHqlExpr dataset;
     switch (dictionary->getOperator())
@@ -12562,7 +12532,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityJoinOrDenormalize(BuildCtx & c
     DatasetReference lhsDsRef(dataset1, no_activetable, NULL);
     DatasetReference rhsDsRef(dataset2, no_activetable, NULL);
 
-    bool couldBeKeepOne = keepLimit && (!keepLimit->queryValue() || (keepLimit->queryValue()->getIntValue() <= 1));
+    //bool couldBeKeepOne = keepLimit && (!keepLimit->queryValue() || (keepLimit->queryValue()->getIntValue() <= 1));
     if (dataset1->queryRecord() == dataset2->queryRecord())
     {
         //more could use the compareLeftRight function instead of generating the same code 
@@ -13128,7 +13098,6 @@ ABoundActivity * HqlCppTranslator::doBuildActivitySelectNth(BuildCtx & ctx, IHql
 
     //If selecting 1st element of a non-grouped aggregate (which can only produce one row) then don't need to 
     //add the selectNth operator.
-    IHqlExpression * search = dataset;
     if (hasSingleRow(dataset))
     {
         IValue * indexValue = index->queryValue();
@@ -19066,7 +19035,7 @@ StringBuffer &expandDotLiteral(StringBuffer &s, const char *f)
         case '\"':
         case '\'':
             s.append('\\');
-            // fall into...
+            // fallthrough
         default:
             if (chars++ > 1000)
                 return s;
@@ -19261,8 +19230,7 @@ void HqlCppTranslator::traceExpressions(const char * title, WorkflowArray & work
 
     // DBGLOG("%s",title);
     LOG(MCdebugInfo(200), unknownJob, "Tracing expressions: %s", title);
-    static LogMsgCategory debug500 = MCdebugInfo(500);
-    static LogMsgCategory debug5000 = MCdebugInfo(5000);
+    static constexpr LogMsgCategory debug500 = MCdebugInfo(500);
     if(REJECTLOG(debug500))
         return;
 
@@ -19686,8 +19654,8 @@ bool HqlCppTranslator::needsRealThor(IHqlExpression *expr, unsigned flags)
             if (!containsAnyDataset(child0))
                 return false;
 //          return needsRealThor(child0, isFiltered, diskReadsOnHThor);
-            //fallthrough...
         }
+        // fallthrough...
 
     default:
         if (expr->isDataset())

+ 6 - 6
ecl/hqlcpp/hqlhtcpp.ipp

@@ -188,8 +188,8 @@ protected:
 
 public:
     HqlCppTranslator & translator;
-    unsigned     activityId;
-    unsigned     numChildQueries;
+    unsigned     activityId = 0;
+    unsigned     numChildQueries = 0;
     ThorActivityKind kind;
     HqlExprAttr  activityExpr;
     LinkedHqlExpr sourceFileSequence;
@@ -202,8 +202,8 @@ public:
     StringAttr   graphLabel;
     StringBuffer baseClassExtra;
     MetaInstance meta;
-    IIdAtom *        implementationClassName;
-    ABoundActivity* table;
+    IIdAtom *        implementationClassName = nullptr;
+    ABoundActivity* table = nullptr;
     bool         isMember;
     bool         instanceIsLocal;
     bool         isCoLocal;
@@ -226,8 +226,8 @@ public:
     LocationArray locations;
 
     Linked<IPropertyTree> graphNode;
-    IHqlStmt *   classStmt;
-    IHqlStmt *   classGroupStmt;
+    IHqlStmt *   classStmt = nullptr;
+    IHqlStmt *   classGroupStmt = nullptr;
     BuildCtx    classctx;
     BuildCtx    createctx;
     BuildCtx    startctx;

+ 8 - 13
ecl/hqlcpp/hqliproj.cpp

@@ -964,11 +964,6 @@ static node_operator queryCompoundOp(IHqlExpression * expr)
     throwUnexpectedOp(expr->getOperator());
 }
 
-static int compareHqlExprPtr(IInterface * * left, IInterface * * right) 
-{
-    return *left == *right ? 0 : *left < *right ? -1 : +1;
-}
-
 inline bool hasActivityType(IHqlExpression * expr)
 {
     return (expr->isDataset() || expr->isDatarow() || expr->isDictionary());
@@ -1288,7 +1283,7 @@ ImplicitProjectTransformer::ImplicitProjectTransformer(HqlCppTranslator & _trans
     allowActivity = true;
     options.insertProjectCostLevel = 0;
     if (transOptions.reduceNetworkTraffic)
-        options.insertProjectCostLevel = (transOptions.insertProjectCostLevel != (unsigned)-1) ? transOptions.insertProjectCostLevel : CostNetworkCopy;
+        options.insertProjectCostLevel = (transOptions.insertProjectCostLevel != (unsigned)-1) ? transOptions.insertProjectCostLevel : (unsigned)CostNetworkCopy;
 }
 
 
@@ -2950,8 +2945,8 @@ IHqlExpression * ImplicitProjectTransformer::createTransformed(IHqlExpression *
                 args.append(*complexExtra->createOutputProject(transformed->queryChild(0)));
                 transformed.setown(transformed->clone(args));
                 logChange("Project output from compound", expr, complexExtra->outputFields);
-                break;
             }
+            break;
         }
     case CompoundableActivity:
         {
@@ -3225,12 +3220,12 @@ void ImplicitProjectTransformer::percolateFields()
 
 IHqlExpression * ImplicitProjectTransformer::process(IHqlExpression * expr)
 {
-    cycle_t time1 = msTick();
+    //cycle_t time1 = msTick();
     analyse(expr, 0);           // gather a list of activities, and link them together.
-    cycle_t time2 = msTick();
+    //cycle_t time2 = msTick();
     //DEBUG_TIMERX(translator.queryTimeReporter(), "EclServer: implicit.analyse", time2-time1);
     percolateFields();
-    cycle_t time3 = msTick();
+    //cycle_t time3 = msTick();
     //DEBUG_TIMERX(translator.queryTimeReporter(), "EclServer: implicit.percolate", time3-time2);
     switch (targetClusterType)
     {
@@ -3248,14 +3243,14 @@ IHqlExpression * ImplicitProjectTransformer::process(IHqlExpression * expr)
             insertProjects();
         break;
     }
-    cycle_t time4 = msTick();
+    //cycle_t time4 = msTick();
     //DEBUG_TIMERX(translator.queryTimeReporter(), "EclServer: implicit.reduceData", time4-time3);
     finalizeFields();
-    cycle_t time5 = msTick();
+    //cycle_t time5 = msTick();
     //DEBUG_TIMERX(translator.queryTimeReporter(), "EclServer: implicit.finalize", time5-time4);
     //traceActivities();
     OwnedHqlExpr ret = transformRoot(expr);
-    cycle_t time6 = msTick();
+    //cycle_t time6 = msTick();
     //DEBUG_TIMERX(translator.queryTimeReporter(), "EclServer: implicit.transform", time6-time5);
     return ret.getClear();
 }

+ 1 - 1
ecl/hqlcpp/hqliter.ipp

@@ -50,8 +50,8 @@ protected:
 
 protected:
     HqlCppTranslator & translator;
-    BuildCtx & declarectx;
     BuildCtx & nestedctx;
+    BuildCtx & declarectx;
 };
 
 

+ 1 - 1
ecl/hqlcpp/hqllib.cpp

@@ -47,7 +47,7 @@ static IHqlExpression * queryLibraryInputSequence(IHqlExpression * expr)
     return arg;
 }
 
-HqlCppLibrary::HqlCppLibrary(HqlCppTranslator & _translator, IHqlExpression * libraryInterface, ClusterType _clusterType) : translator(_translator), inputMapper(libraryInterface), clusterType(_clusterType)
+HqlCppLibrary::HqlCppLibrary(HqlCppTranslator & _translator, IHqlExpression * libraryInterface, ClusterType _clusterType) : translator(_translator), clusterType(_clusterType), inputMapper(libraryInterface)
 {
     assertex(libraryInterface->getOperator() == no_funcdef);
     scopeExpr = libraryInterface->queryChild(0);

+ 1 - 1
ecl/hqlcpp/hqlregex.cpp

@@ -843,7 +843,7 @@ static bool canConsume(const ParseInformation & options, unsigned nextChar, unsi
     rtlThrowNoUnicode();
 #endif
 
-    return (nextChar == tolower(matcherChar)) || (nextChar == toupper(matcherChar));
+    return (nextChar == (unsigned)tolower(matcherChar)) || (nextChar == (unsigned)toupper(matcherChar));
 }
 
 bool HqlRegexExpr::canConsume(unsigned nextChar)

+ 1 - 1
ecl/hqlcpp/hqlres.cpp

@@ -493,7 +493,7 @@ void ResourceManager::finalize()
 
 void ResourceManager::putbytes(int h, const void *b, unsigned len)
 {
-    int written = _write(h, b, len);
+    unsigned written = _write(h, b, len);
     assertex(written == len);
     totalbytes += len;
 }

+ 5 - 3
ecl/hqlcpp/hqlresource.cpp

@@ -552,7 +552,6 @@ protected:
             return;
         }
 
-        IHqlExpression * body = expr->queryBody();
         if (alreadyVisited(expr))
             return;
 
@@ -5633,7 +5632,6 @@ void EclResourcer::extractSharedInputs(CSplitterInfo & connections, ResourceGrap
     ForEachItemIn(i, connections.externalSources)
     {
         IHqlExpression & cur = connections.externalSources.item(i);
-        ResourcerInfo * info = queryResourceInfo(&cur);
         if (connections.isBalancedSplitter(&cur))
         {
             //Add two entries for compatibility with old code.
@@ -5688,6 +5686,7 @@ void EclResourcer::spotUnbalancedSplitters(const HqlExprArray & exprs)
 // PASS6: Merge sub graphs that can share resources and don't have dependencies
 // MORE: Once sources are merged, should try merging between trees.
 
+#if 0 // Unused function
 static bool conditionsMatch(const HqlExprArray & left, const HqlExprArray & right)
 {
     if (left.ordinality() != right.ordinality())
@@ -5700,6 +5699,7 @@ static bool conditionsMatch(const HqlExprArray & left, const HqlExprArray & righ
     }
     return true;
 }
+#endif
 
 
 bool EclResourcer::queryMergeGraphLink(ResourceGraphLink & link)
@@ -6090,6 +6090,8 @@ void EclResourcer::moveExternalSpillPoints()
 //------------------------------------------------------------------------------------------
 // PASS9: Create a new expression tree representing the information
 
+#if 0
+//Function not currently used
 static IHqlExpression * getScalarReplacement(CChildDependent & cur, ResourcerInfo * hoistedInfo, IHqlExpression * replacement)
 {
     //First skip any wrappers which are there to cause things to be hoisted.
@@ -6126,7 +6128,7 @@ static IHqlExpression * getScalarReplacement(CChildDependent & cur, ResourcerInf
     IHqlExpression * record = replacement->queryRecord();
     return createNewSelectExpr(LINK(replacement), LINK(record->queryChild(0)));
 }
-
+#endif
 
 IHqlExpression * EclResourcer::doCreateResourced(IHqlExpression * expr, ResourceGraphInfo * ownerGraph, bool expandInParent, bool defineSideEffect)
 {

+ 1 - 1
ecl/hqlcpp/hqlresource.ipp

@@ -248,9 +248,9 @@ public:
     IHqlExpression * original;
     LinkedHqlExpr hoisted;
     LinkedHqlExpr projectedHoisted;
-    bool forceHoist;
     bool alwaysHoist;
     bool isSingleNode;
+    bool forceHoist;
     IHqlExpression * projected;
 };
 

+ 1 - 1
ecl/hqlcpp/hqlsource.cpp

@@ -635,7 +635,7 @@ class SourceBuilder
 {
 public:
     SourceBuilder(HqlCppTranslator & _translator, IHqlExpression *_tableExpr, IHqlExpression *_nameExpr)
-        : tableExpr(_tableExpr), translator(_translator), newInputMapping(false)
+        : tableExpr(_tableExpr), newInputMapping(false), translator(_translator)
     { 
         nameExpr.setown(foldHqlExpression(_nameExpr));
         needDefaultTransform = true; 

+ 2 - 2
ecl/hqlcpp/hqlstmt.cpp

@@ -796,9 +796,9 @@ void BuildCtx::walkAssociations(AssocKind searchMask, IAssociationVisitor & visi
         if (searchStmts->associationMask & searchMask)
         {
             CIArray & defs = searchStmts->defs;
-            ForEachItemInRev(idx, searchStmts->defs)
+            ForEachItemInRev(idx, defs)
             {
-                HqlExprAssociation & cur = (HqlExprAssociation &)searchStmts->defs.item(idx);
+                HqlExprAssociation & cur = (HqlExprAssociation &)defs.item(idx);
                 if (cur.getKind() & searchMask)
                 {
                     if (visitor.visit(cur))

+ 1 - 2
ecl/hqlcpp/hqltcppc.cpp

@@ -777,7 +777,6 @@ void CMemberInfo::checkAssignOk(HqlCppTranslator & translator, BuildCtx & ctx, I
     else
     {
         unsigned maxRowSize = row->getMaxSize();
-        unsigned fixedSize = totalSize.getFixedSize();
 
         //This removes calls that can be constant folded - a bit confusing in the generated code sometimes..
         if (!row->queryBuilder() && !totalSize.queryVarSize())
@@ -3108,7 +3107,7 @@ void CXmlColumnInfo::setColumn(HqlCppTranslator & translator, BuildCtx & ctx, IR
 inline int doAlign(unsigned value, unsigned align) { return (value + align-1) & ~(align-1); }
 
 ColumnToOffsetMap::ColumnToOffsetMap(IHqlExpression * _key, IHqlExpression * _record, unsigned _id, unsigned _packing, unsigned _maxRecordSize, bool _translateVirtuals, bool _useAccessClass)
-: root(NULL, NULL, _record), key(_key), id(_id)
+: id(_id), key(_key), root(NULL, NULL, _record)
 { 
     record = _record;
     prior = NULL;

+ 0 - 1
ecl/hqlcpp/hqltcppc2.cpp

@@ -346,7 +346,6 @@ void CChildDatasetColumnInfo::setColumn(HqlCppTranslator & translator, BuildCtx
     OwnedHqlExpr lengthTarget = convertAddressToValue(addressSize, sizetType);
 
     ITypeInfo * columnType = column->queryType();
-    IHqlExpression * record = column->queryRecord();
     OwnedHqlExpr value = addDatasetLimits(translator, ctx, selector, _value);
     ITypeInfo * valueType = value->queryType();
     assertRecordTypesMatch(valueType, columnType);

+ 4 - 24
ecl/hqlcpp/hqlttcpp.cpp

@@ -501,6 +501,7 @@ IHqlExpression * NewThorStoredReplacer::createTransformed(IHqlExpression * expr)
                         forceConstant = true;
                         break;
                     }
+                    // fallthrough
                 default:
                     onlyStored = false;
                     break;
@@ -586,6 +587,7 @@ IHqlExpression * NewThorStoredReplacer::createTransformed(IHqlExpression * expr)
                                 getFriendlyTypeStr(replacementType, replacementTypeText);
                                 translator.reportError(expr, ECODETEXT(HQLERR_HashStoredTypeMismatch), nameText.str(), exprTypeText.str(), replacementTypeText.str());
                             }
+                            // fallthrough
                         default:
                             replacement.setown(ensureExprType(replacement, exprType));
                         }
@@ -1018,7 +1020,7 @@ YesNoOption HqlThorBoundaryTransformer::calcNormalizeThor(IHqlExpression * expr)
         {
             if (functionCallIsActivity(expr))
                 return OptionYes;
-            YesNoOption bodyOption = normalizeThor(expr->queryBody()->queryFunctionDefinition());
+            //YesNoOption bodyOption = normalizeThor(expr->queryBody()->queryFunctionDefinition());
             //do Something with it
             break;
         }
@@ -5098,7 +5100,6 @@ IHqlExpression * OptimizeActivityTransformer::optimizeCompare(IHqlExpression * l
     {
         if (lhs->getOperator() == no_count)
         {
-            IHqlExpression * ds = lhs->queryChild(0);
             HqlExprArray args;
             unwindChildren(args, lhs);
             OwnedHqlExpr ret = createValue(no_exists, makeBoolType(), args);
@@ -5791,18 +5792,6 @@ void GlobalAttributeInfo::splitSmallDataset(IHqlExpression * value, SharedHqlExp
 
 //------------------------------------------------------------------------
 
-static bool isStored(IHqlExpression * set)
-{
-    switch (set->getOperator())
-    {
-    case no_setresult:
-    case no_ensureresult:
-    case no_output:
-        return matchesConstantValue(queryAttributeChild(set, sequenceAtom, 0), ResultSequenceStored);
-    }
-    return false;
-}
-
 static bool isTrivialStored(IHqlExpression * set)
 {
     switch (set->getOperator())
@@ -12506,7 +12495,6 @@ IHqlExpression * HqlTreeNormalizer::transformTransform(IHqlExpression * expr)
 
 IHqlExpression * HqlTreeNormalizer::transformIfAssert(node_operator newOp, IHqlExpression * expr)
 {
-    unsigned max = expr->numChildren();
     HqlExprArray children;
     bool same = transformChildren(expr, children);
     if ((expr->hasAttribute(assertAtom) || (options.assertSortedDistributed && (newOp != no_assertgrouped))) && !options.removeAsserts)
@@ -13566,7 +13554,7 @@ IHqlExpression * HqlTreeNormalizer::createTransformedBody(IHqlExpression * expr)
         if (options.outputRowsAsDatasets && expr->queryChild(0)->isDatarow())
         {
             HqlExprArray args;
-            bool same = transformChildren(expr, args);
+            transformChildren(expr, args);
             args.replace(*createDatasetFromRow(LINK(&args.item(0))), 0);
             return createValue(no_output, makeVoidType(), args);
         }
@@ -13876,8 +13864,6 @@ void hoistNestedCompound(HqlCppTranslator & translator, WorkflowArray & workflow
 
 //---------------------------------------------------------------------------
 
-static IHqlExpression * substituteClusterSize(unsigned numNodes, IHqlExpression * expr, ICodegenContextCallback * ctxCallback, IWorkUnit * wu);
-
 static HqlTransformerInfo clusterSubstitueTransformerInfo("ClusterSubstitueTransformer");
 class ClusterSubstitueTransformer : public NewHqlTransformer
 {
@@ -13959,12 +13945,6 @@ protected:
     OwnedHqlExpr clusterSizeValue;
 };
 
-IHqlExpression * substituteClusterSize(unsigned numNodes, IHqlExpression * expr, ICodegenContextCallback * ctxCallback, IWorkUnit * wu)
-{
-    ClusterSubstitueTransformer transformer(numNodes, ctxCallback, wu);
-    return transformer.transformRoot(expr);
-}
-
 void HqlCppTranslator::checkWorkflowDuplication(HqlExprArray & exprs)
 {
     const unsigned minActivities = options.checkDuplicateMinActivities;

+ 1 - 3
ecl/hqlcpp/hqlwcpp.cpp

@@ -391,7 +391,6 @@ void HqlCppWriter::generateType(ITypeInfo * type, const char * name)
     for (;;)
     {
         bool isPointer = false;
-        bool outOfLine= false;
         ITypeInfo * fullType = type;
         for (;;)
         {
@@ -404,7 +403,6 @@ void HqlCppWriter::generateType(ITypeInfo * type, const char * name)
                 result.addConst();
                 break;
             case typemod_outofline:
-                outOfLine = false;
                 break;
             case typemod_ref:
                 isPointer = true;
@@ -984,7 +982,7 @@ void HqlCppWriter::generateParamCpp(IHqlExpression * param, IHqlExpression * att
     case type_row:
         if (isConst)
             out.append("const ");
-        /* no break */
+        // fallthrough
     default:
         {
             Owned<ITypeInfo> argType = LINK(paramType);

+ 47 - 47
rtl/eclrtl/rtlfield.hpp

@@ -77,10 +77,10 @@ protected:
 
 //-------------------------------------------------------------------------------------------------------------------
 
-struct ECLRTL_API RtlBoolTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlBoolTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlBoolTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t build(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, IFieldSource &source) const override;
     virtual size32_t buildInt(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, __int64 val) const override;
@@ -98,10 +98,10 @@ protected:
     bool getBool(const void * ptr) const;
 };
 
-struct ECLRTL_API RtlRealTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlRealTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlRealTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t build(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, IFieldSource &source) const override;
     virtual size32_t buildReal(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, double val) const override;
@@ -122,10 +122,10 @@ private:
     inline double value(const void * self) const;
 };
 
-struct ECLRTL_API RtlIntTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlIntTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlIntTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t build(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, IFieldSource &source) const override;
     virtual size32_t buildInt(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, __int64 val) const override;
@@ -146,13 +146,13 @@ struct ECLRTL_API RtlIntTypeInfo : public RtlTypeInfoBase
     virtual unsigned hash(const byte *self, unsigned inhash) const override;
 };
 
-struct ECLRTL_API RtlBlobTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlBlobTypeInfo final : public RtlTypeInfoBase
 {
     // Used for values stored in blobs. The child type represents the original type
     constexpr inline RtlBlobTypeInfo(unsigned _fieldType, unsigned _length, const RtlTypeInfo *_child)
     : RtlTypeInfoBase(_fieldType, _length), child(_child)
     {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t build(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, IFieldSource &source) const override;
@@ -177,10 +177,10 @@ private:
     const RtlTypeInfo *child = nullptr;
 };
 
-struct ECLRTL_API RtlSwapIntTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlSwapIntTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlSwapIntTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t build(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, IFieldSource &source) const override;
     virtual size32_t buildInt(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, __int64 val) const override;
@@ -204,7 +204,7 @@ struct ECLRTL_API RtlSwapIntTypeInfo : public RtlTypeInfoBase
 struct ECLRTL_API RtlKeyedIntTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlKeyedIntTypeInfo(unsigned _fieldType, unsigned _length, const RtlTypeInfo *_child) : RtlTypeInfoBase(_fieldType, _length), child(_child) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t build(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, IFieldSource &source) const override;
     virtual size32_t buildInt(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, __int64 val) const override;
@@ -230,10 +230,10 @@ private:
     const RtlTypeInfo *child = nullptr;
 };
 
-struct ECLRTL_API RtlPackedIntTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlPackedIntTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlPackedIntTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -255,10 +255,10 @@ struct ECLRTL_API RtlPackedIntTypeInfo : public RtlTypeInfoBase
     virtual unsigned hash(const byte *self, unsigned inhash) const override;
 };
 
-struct ECLRTL_API RtlStringTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlStringTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlStringTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -281,10 +281,10 @@ struct ECLRTL_API RtlStringTypeInfo : public RtlTypeInfoBase
     virtual int compareRange(size32_t lenLeft, const byte * left, size32_t lenRight, const byte * right) const override;
 };
 
-struct ECLRTL_API RtlDataTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlDataTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlDataTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -306,10 +306,10 @@ struct ECLRTL_API RtlDataTypeInfo : public RtlTypeInfoBase
     virtual int compareRange(size32_t lenLeft, const byte * left, size32_t lenRight, const byte * right) const override;
 };
 
-struct ECLRTL_API RtlVarStringTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlVarStringTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlVarStringTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -330,10 +330,10 @@ struct ECLRTL_API RtlVarStringTypeInfo : public RtlTypeInfoBase
     virtual void setBound(void * buffer, const byte * value, size32_t subLength, byte fill, bool inclusive) const override;
 };
 
-struct ECLRTL_API RtlQStringTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlQStringTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlQStringTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -355,10 +355,10 @@ struct ECLRTL_API RtlQStringTypeInfo : public RtlTypeInfoBase
     virtual void setBound(void * buffer, const byte * value, size32_t subLength, byte fill, bool inclusive) const override;
 };
 
-struct ECLRTL_API RtlDecimalTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlDecimalTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlDecimalTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -378,10 +378,10 @@ struct ECLRTL_API RtlDecimalTypeInfo : public RtlTypeInfoBase
     size32_t calcSize() const;
 };
 
-struct ECLRTL_API RtlCharTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlCharTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlCharTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t build(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, IFieldSource &source) const override;
     virtual size32_t buildString(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, size32_t size, const char *value) const override;
@@ -396,11 +396,11 @@ struct ECLRTL_API RtlCharTypeInfo : public RtlTypeInfoBase
     virtual unsigned hash(const byte *self, unsigned inhash) const override;
 };
 
-struct ECLRTL_API RtlUnicodeTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlUnicodeTypeInfo final : public RtlTypeInfoBase
 {
 public:
     constexpr inline RtlUnicodeTypeInfo(unsigned _fieldType, unsigned _length, const char * _locale) : RtlTypeInfoBase(_fieldType, _length), locale(_locale) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -426,11 +426,11 @@ protected:
     const char * locale;
 };
 
-struct ECLRTL_API RtlVarUnicodeTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlVarUnicodeTypeInfo final : public RtlTypeInfoBase
 {
 public:
     constexpr inline RtlVarUnicodeTypeInfo(unsigned _fieldType, unsigned _length, const char * _locale) : RtlTypeInfoBase(_fieldType, _length), locale(_locale) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -456,11 +456,11 @@ protected:
     const char * locale;
 };
 
-struct ECLRTL_API RtlUtf8TypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlUtf8TypeInfo final : public RtlTypeInfoBase
 {
 public:
     constexpr inline RtlUtf8TypeInfo(unsigned _fieldType, unsigned _length, const char * _locale) : RtlTypeInfoBase(_fieldType, _length), locale(_locale) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -485,10 +485,10 @@ protected:
     const char * locale;
 };
 
-struct ECLRTL_API RtlRecordTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlRecordTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlRecordTypeInfo(unsigned _fieldType, unsigned _length, const RtlFieldInfo * const * _fields) : RtlTypeInfoBase(_fieldType, _length), fields(_fields) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
     const RtlFieldInfo * const * fields;                // null terminated
 
     virtual size32_t getMinSize() const override;
@@ -526,10 +526,10 @@ struct ECLRTL_API RtlCompoundTypeInfo : public RtlTypeInfoBase
 };
 
 
-struct ECLRTL_API RtlSetTypeInfo : public RtlCompoundTypeInfo
+struct ECLRTL_API RtlSetTypeInfo final : public RtlCompoundTypeInfo
 {
     constexpr inline RtlSetTypeInfo(unsigned _fieldType, unsigned _length, const RtlTypeInfo * _child) : RtlCompoundTypeInfo(_fieldType, _length, _child) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -542,10 +542,10 @@ struct ECLRTL_API RtlSetTypeInfo : public RtlCompoundTypeInfo
     virtual unsigned hash(const byte *self, unsigned inhash) const override;
 };
 
-struct ECLRTL_API RtlRowTypeInfo : public RtlCompoundTypeInfo
+struct ECLRTL_API RtlRowTypeInfo final : public RtlCompoundTypeInfo
 {
     constexpr inline RtlRowTypeInfo(unsigned _fieldType, unsigned _length, const RtlTypeInfo * _child) : RtlCompoundTypeInfo(_fieldType, _length, _child) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -558,10 +558,10 @@ struct ECLRTL_API RtlRowTypeInfo : public RtlCompoundTypeInfo
 };
 
 
-struct ECLRTL_API RtlDatasetTypeInfo : public RtlCompoundTypeInfo
+struct ECLRTL_API RtlDatasetTypeInfo final : public RtlCompoundTypeInfo
 {
     constexpr inline RtlDatasetTypeInfo(unsigned _fieldType, unsigned _length, const RtlTypeInfo * _child) : RtlCompoundTypeInfo(_fieldType, _length, _child) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -575,11 +575,11 @@ struct ECLRTL_API RtlDatasetTypeInfo : public RtlCompoundTypeInfo
 };
 
 
-struct ECLRTL_API RtlDictionaryTypeInfo : public RtlCompoundTypeInfo
+struct ECLRTL_API RtlDictionaryTypeInfo final : public RtlCompoundTypeInfo
 {
     constexpr inline RtlDictionaryTypeInfo(unsigned _fieldType, unsigned _length, const RtlTypeInfo * _child)
     : RtlCompoundTypeInfo(_fieldType, _length, _child) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -669,10 +669,10 @@ struct ECLRTL_API RtlDynamicIfBlockTypeInfo final : public RtlSerialIfBlockTypeI
     void setParent(const RtlRecordTypeInfo * _rowType) { rowType = _rowType; }
 };
 
-struct ECLRTL_API RtlBitfieldTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlBitfieldTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlBitfieldTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t buildInt(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, __int64 val) const override;
     virtual size32_t buildString(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, size32_t size, const char *value) const override;
@@ -693,10 +693,10 @@ protected:
     unsigned __int64 unsignedValue(const void * self) const;
 };
 
-struct ECLRTL_API RtlUnimplementedTypeInfo : public RtlTypeInfoBase
+struct ECLRTL_API RtlUnimplementedTypeInfo final : public RtlTypeInfoBase
 {
     constexpr inline RtlUnimplementedTypeInfo(unsigned _fieldType, unsigned _length) : RtlTypeInfoBase(_fieldType, _length) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t getMinSize() const override;
     virtual size32_t size(const byte * self, const byte * selfrow) const override;
@@ -714,11 +714,11 @@ struct ECLRTL_API RtlUnimplementedTypeInfo : public RtlTypeInfoBase
     virtual unsigned hash(const byte *self, unsigned inhash) const override;
 };
 
-struct ECLRTL_API RtlAlienTypeInfo : public RtlCompoundTypeInfo
+struct ECLRTL_API RtlAlienTypeInfo final : public RtlCompoundTypeInfo
 {
 public:
     constexpr inline RtlAlienTypeInfo(unsigned _fieldType, unsigned _length, const RtlTypeInfo * _child) : RtlCompoundTypeInfo(_fieldType, _length, _child) {}
-    virtual void doDelete() const final override { delete this; }
+    virtual void doDelete() const override { delete this; }
 
     virtual size32_t buildInt(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, __int64 val) const override;
     virtual size32_t buildString(ARowBuilder &builder, size32_t offset, const RtlFieldInfo *field, size32_t size, const char *value) const override;

+ 1 - 1
system/jlib/jexcept.cpp

@@ -1726,7 +1726,7 @@ IError *createError(IPropertyTree * tree)
 
 //---------------------------------------------------------------------------------------------------------------------
 
-void IErrorReceiver::ThrowStringException(int code,const char *format, ...) const
+void IErrorReceiver::throwStringExceptionV(int code,const char *format, ...) const
 {
     va_list args;
     va_start(args, format);

+ 1 - 1
system/jlib/jexcept.hpp

@@ -241,7 +241,7 @@ interface jlib_decl IErrorReceiver : public IInterface
     virtual size32_t errCount() = 0;
     virtual size32_t warnCount() = 0;
     virtual void exportMappings(IWorkUnit * wu) const = 0;
-    virtual __declspec(noreturn) void ThrowStringException(int code,const char *format, ...) const __attribute__((format(printf, 3, 4), noreturn));            // override the global function to try and add more context information
+    virtual __declspec(noreturn) void throwStringExceptionV(int code,const char *format, ...) const __attribute__((format(printf, 3, 4), noreturn));            // override the global function to try and add more context information
 
     //global helper functions
     void reportError(int errNo, const char *msg, const char *filename, int lineno, int column, int pos);