Browse Source

HPCC-10977 Fix warnings in the code generator

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 11 years ago
parent
commit
5850bddf89

+ 9 - 2
ecl/hql/hqlerror.cpp

@@ -42,6 +42,9 @@ ErrorSeverity queryDefaultSeverity(WarnErrorCategory category)
         return SeverityFatal;
     if (category == CategoryInformation)
         return SeverityInfo;
+//MORE: Should the following be enabled?
+//    if (category == CategoryMistake)
+//        return SeverityError;
     return SeverityWarning;
 }
 
@@ -57,6 +60,8 @@ WarnErrorCategory getCategory(const char * category)
         return CategoryDeprecated;
     if (strieq(category, "efficiency"))
         return CategoryEfficiency;
+    if (strieq(category, "fold"))
+        CategoryFolding;
     if (strieq(category, "future"))
         return CategoryFuture;
     if (strieq(category, "ignored"))
@@ -65,8 +70,10 @@ WarnErrorCategory getCategory(const char * category)
         return CategoryIndex;
     if (strieq(category, "info"))
         return CategoryInformation;
-    if (strieq(category, "mistype"))
-        return CategoryMistyped;
+    if (strieq(category, "mistake"))
+        return CategoryMistake;
+    if (strieq(category, "limit"))
+        return CategoryLimit;
     if (strieq(category, "syntax"))
         return CategorySyntax;
     if (strieq(category, "unusual"))

+ 3 - 1
ecl/hql/hqlerror.hpp

@@ -45,10 +45,12 @@ enum WarnErrorCategory
     CategoryConfuse,    // Likely to cause confusion
     CategoryDeprecated, // deprecated features or syntax
     CategoryEfficiency, // Something that is likely to be inefficient
+    CategoryFolding,    // Unusual results from constant folding
     CategoryFuture,     // Likely to cause problems in future versions
     CategoryIgnored,    // Something that has no effect, or is ignored
     CategoryIndex,      // Unusual indexing of datasets or strings
-    CategoryMistyped,   // Almost certainly mistyped
+    CategoryMistake,    // Almost certainly a mistake
+    CategoryLimit,      // An operation that should really have some limits to protect data runaway
     CategorySyntax,     // Invalid syntax which is painless to recover from
     CategoryUnusual,    // Not strictly speaking an error, but highly unusual and likely to be a mistake
     CategoryUnexpected, // Code that could be correct, but has the potential for unexpected behaviour

+ 4 - 4
ecl/hql/hqlerrors.hpp

@@ -525,10 +525,10 @@
 
 #define ECODETEXT(x)                (x), (x##_Text)
 
-#define WARNING(x)                  reportWarning(x, x##_Text)
-#define WARNING1(x, a)              reportWarning(x, x##_Text, a)
-#define WARNING2(x, a, b)           reportWarning(x, x##_Text, a, b)
-#define WARNING3(x, a, b, c)        reportWarning(x, x##_Text, a, b, c)
+#define WARNING(cat, x)                  reportWarning(cat, x, x##_Text)
+#define WARNING1(cat, x, a)              reportWarning(cat, x, x##_Text, a)
+#define WARNING2(cat, x, a, b)           reportWarning(cat, x, x##_Text, a, b)
+#define WARNING3(cat, x, a, b, c)        reportWarning(cat, x, x##_Text, a, b, c)
 
 #define ERRORAT(e, x)               reportError(e, x, x##_Text)
 #define ERRORAT1(e, x, a)           reportError(e, x, x##_Text, a)

+ 4 - 4
ecl/hql/hqlutil.cpp

@@ -5490,7 +5490,7 @@ protected:
     void createTempTableAssign(HqlExprArray & assigns, IHqlExpression * self, IHqlExpression * curRow, IHqlExpression * expr, unsigned & col, IHqlExpression * selector, HqlMapTransformer & mapper, bool included);
     IHqlExpression * createTempTableTransform(IHqlExpression * self, IHqlExpression * curRow, IHqlExpression * expr, unsigned & col, IHqlExpression * selector, HqlMapTransformer & mapper, bool included);
 
-    void reportWarning(IHqlExpression * location, int code,const char *format, ...) __attribute__((format(printf, 4, 5)));
+    void reportWarning(WarnErrorCategory category, IHqlExpression * location, int code,const char *format, ...) __attribute__((format(printf, 5, 6)));
     void reportError(IHqlExpression * location, int code,const char *format, ...) __attribute__((format(printf, 4, 5)));
 
 protected:
@@ -5715,7 +5715,7 @@ void TempTableTransformer::createTempTableAssign(HqlExprArray & assigns, IHqlExp
             if (included)
             {
                 if (!mappedValue)
-                    reportWarning(NULL, HQLWRN_CouldNotConstantFoldIf, HQLWRN_CouldNotConstantFoldIf_Text);
+                    reportWarning(CategoryUnexpected, NULL, HQLWRN_CouldNotConstantFoldIf, HQLWRN_CouldNotConstantFoldIf_Text);
                 else if (!mappedValue->getBoolValue())
                     included = false;
             }
@@ -5755,7 +5755,7 @@ void TempTableTransformer::reportError(IHqlExpression * location, int code,const
     errorProcessor.report(err);
 }
 
-void TempTableTransformer::reportWarning(IHqlExpression * location, int code,const char *format, ...)
+void TempTableTransformer::reportWarning(WarnErrorCategory category, IHqlExpression * location, int code,const char *format, ...)
 {
     ECLlocation * where = &defaultLocation;
     ECLlocation thisLocation;
@@ -5770,7 +5770,7 @@ void TempTableTransformer::reportWarning(IHqlExpression * location, int code,con
     va_start(args, format);
     errorMsg.valist_appendf(format, args);
     va_end(args);
-    errorProcessor.reportWarning(CategoryUnknown, code, errorMsg.str(), where->sourcePath->str(), where->lineno, where->column, where->position);
+    errorProcessor.reportWarning(category, code, errorMsg.str(), where->sourcePath->str(), where->lineno, where->column, where->position);
 }
 
 IHqlExpression *getDictionaryKeyRecord(IHqlExpression *record)

+ 4 - 4
ecl/hqlcpp/hqlcerrors.hpp

@@ -581,9 +581,9 @@
 #define HQLERR_UnknownCompoundAssign_Text       "INTERNAL: Unrecognised compound assign %s"
 #define HQLERR_ReadSpillBeforeWriteFix_Text     "INTERNAL: Attempt to read spill file %s before it is written.  Try adding #option ('allowThroughSpill', false); to the query."
 
-#define WARNINGAT(e, x)                 reportWarning(e, x, x##_Text)
-#define WARNINGAT1(e, x, a)             reportWarning(e, x, x##_Text, a)
-#define WARNINGAT2(e, x, a, b)          reportWarning(e, x, x##_Text, a, b)
-#define WARNINGAT3(e, x, a, b, c)       reportWarning(e, x, x##_Text, a, b, c)
+#define WARNINGAT(cat, e, x)                 reportWarning(cat, e, x, x##_Text)
+#define WARNINGAT1(cat, e, x, a)             reportWarning(cat, e, x, x##_Text, a)
+#define WARNINGAT2(cat, e, x, a, b)          reportWarning(cat, e, x, x##_Text, a, b)
+#define WARNINGAT3(cat, e, x, a, b, c)       reportWarning(cat, e, x, x##_Text, a, b, c)
 
 #endif

+ 7 - 7
ecl/hqlcpp/hqlcpp.cpp

@@ -2035,37 +2035,37 @@ bool HqlCppTranslator::getDebugFlag(const char * name, bool defValue)
     return wu()->getDebugValueBool(name, defValue);
 }
 
-void HqlCppTranslator::doReportWarning(IHqlExpression * location, unsigned id, const char * msg)
+void HqlCppTranslator::doReportWarning(WarnErrorCategory category, IHqlExpression * location, unsigned id, const char * msg)
 {
     Owned<IECLError> warnError;
     if (!location)
         location = queryActiveActivityLocation();
     if (location)
-        warnError.setown(createECLError(CategoryUnknown, SeverityWarning, id, msg, location->querySourcePath()->str(), location->getStartLine(), location->getStartColumn(), 0));
+        warnError.setown(createECLError(category, SeverityWarning, id, msg, location->querySourcePath()->str(), location->getStartLine(), location->getStartColumn(), 0));
     else
-        warnError.setown(createECLError(CategoryUnknown, SeverityWarning, id, msg, NULL, 0, 0, 0));
+        warnError.setown(createECLError(category, SeverityWarning, id, msg, NULL, 0, 0, 0));
 
     errorProcessor->report(warnError);
 }
 
-void HqlCppTranslator::reportWarning(IHqlExpression * location, unsigned id, const char * msg, ...)
+void HqlCppTranslator::reportWarning(WarnErrorCategory category, IHqlExpression * location, unsigned id, const char * msg, ...)
 {
     StringBuffer s;
     va_list args;
     va_start(args, msg);
     s.valist_appendf(msg, args);
     va_end(args);
-    doReportWarning(location, id, s.str());
+    doReportWarning(category, location, id, s.str());
 }
 
-void HqlCppTranslator::reportWarning(unsigned id, const char * msg, ...)
+void HqlCppTranslator::reportWarning(WarnErrorCategory category, unsigned id, const char * msg, ...)
 {
     StringBuffer s;
     va_list args;
     va_start(args, msg);
     s.valist_appendf(msg, args);
     va_end(args);
-    doReportWarning(NULL, id, s.str());
+    doReportWarning(category, NULL, id, s.str());
 }
 
 void HqlCppTranslator::addWorkunitException(WUExceptionSeverity severity, unsigned code, const char * text, IHqlExpression * location)

+ 4 - 4
ecl/hqlcpp/hqlcpp.ipp

@@ -915,9 +915,9 @@ public:
     bool registerGlobalUsage(IHqlExpression * filename);
     IHqlExpression * queryActiveNamedActivity();
     IHqlExpression * queryActiveActivityLocation() const;
-    void reportWarning(unsigned id, const char * msg, ...) __attribute__((format(printf, 3, 4)));
-    void reportWarning(IHqlExpression * location, unsigned id, const char * msg, ...) __attribute__((format(printf, 4, 5)));
-    void reportError(IHqlExpression * location, int code,const char *format, ...) __attribute__((format(printf, 4, 5)));
+    void reportWarning(WarnErrorCategory category, unsigned id, const char * msg, ...) __attribute__((format(printf, 4, 5)));
+    void reportWarning(WarnErrorCategory category, IHqlExpression * location, unsigned id, const char * msg, ...) __attribute__((format(printf, 5, 6)));
+    void reportError(IHqlExpression * location, int code, const char *format, ...) __attribute__((format(printf, 4, 5)));
     void reportErrorDirect(IHqlExpression * location, int code,const char *msg, bool alwaysAbort);
     void addWorkunitException(WUExceptionSeverity severity, unsigned code, const char * msg, IHqlExpression * location);
     void useFunction(IHqlExpression * funcdef);
@@ -1821,7 +1821,7 @@ protected:
 
 //ThorHole helper functions...
     IHqlExpression * doBuildDatabaseLoader(BuildCtx & ctx, IHqlExpression * expr);
-    void doReportWarning(IHqlExpression * location, unsigned id, const char * msg);
+    void doReportWarning(WarnErrorCategory category, IHqlExpression * location, unsigned id, const char * msg);
 
     void optimizePersists(HqlExprArray & exprs);
     void allocateSequenceNumbers(HqlExprArray & exprs);

+ 1 - 1
ecl/hqlcpp/hqlcppcase.cpp

@@ -397,7 +397,7 @@ IHqlExpression * HqlCppCaseInfo::buildIndexedMap(BuildCtx & ctx, IHqlExpression
         if (mapTo->getOperator() != no_constant)
             throwUnexpected();
         if (replaceIndex >= num)
-            translator.reportWarning(HQLWRN_CaseCanNeverMatch, "CASE entry %d can never match the test condition", replaceIndex);
+            translator.reportWarning(CategoryIgnored, HQLWRN_CaseCanNeverMatch, "CASE entry %d can never match the test condition", replaceIndex);
         else
             values.replace(*LINK(mapTo),replaceIndex);
     }

+ 3 - 3
ecl/hqlcpp/hqlcppds.cpp

@@ -2734,9 +2734,9 @@ void HqlCppTranslator::doBuildCheckDatasetLimit(BuildCtx & ctx, IHqlExpression *
                 failMessage->queryValue()->getStringValue(failMessageText);
         }
         if (failMessageText.length())
-            WARNING1(HQLWRN_LimitAlwaysExceededX, failMessageText.str());
+            WARNING1(CategoryUnexpected, HQLWRN_LimitAlwaysExceededX, failMessageText.str());
         else
-            WARNING(HQLWRN_LimitAlwaysExceeded);
+            WARNING(CategoryUnexpected, HQLWRN_LimitAlwaysExceeded);
     }
 
     if (!fail)
@@ -5325,7 +5325,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityForceLocal(BuildCtx & ctx, IHq
     IHqlExpression * child = expr->queryChild(0);
     if (targetHThor() || (targetThor() && !insideChildQuery(ctx)))
     {
-        WARNING(HQLWRN_LocalHasNoEffect);
+        WARNING(CategoryIgnored, HQLWRN_LocalHasNoEffect);
         return buildCachedActivity(ctx, child);
     }
 

+ 6 - 6
ecl/hqlcpp/hqlhtcpp.cpp

@@ -2285,7 +2285,7 @@ void ActivityInstance::buildSuffix()
         if (options.spotComplexClasses && (approxSize >= options.complexClassesThreshold))
         {
             if ((options.complexClassesActivityFilter == 0) || (kind == options.complexClassesActivityFilter))
-                translator.WARNING2(HQLWRN_ComplexHelperClass, activityId, approxSize);
+                translator.WARNING2(CategoryEfficiency, HQLWRN_ComplexHelperClass, activityId, approxSize);
         }
         if (options.showActivitySizeInGraph)
             addAttributeInt("approxClassSize", approxSize);
@@ -11584,7 +11584,7 @@ void HqlCppTranslator::doBuildJoinRowLimitHelper(ActivityInstance & instance, IH
             StringBuffer fname;
             if (filename)
                 getExprECL(filename, fname.append(" "));
-            WARNING2(HQLWRN_ImplicitJoinLimit, options.defaultImplicitKeyedJoinLimit, fname.str());
+            WARNING2(CategoryLimit, HQLWRN_ImplicitJoinLimit, options.defaultImplicitKeyedJoinLimit, fname.str());
         }
     }
 }
@@ -11682,7 +11682,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityJoinOrDenormalize(BuildCtx & c
         dataset2.set(dataset2->queryChild(0));
 
     if (expr->hasAttribute(groupedAtom) && targetThor())
-        WARNING(HQLWRN_GroupedJoinIsLookupJoin);
+        WARNING(CategoryEfficiency, HQLWRN_GroupedJoinIsLookupJoin);
 
     //Hash and smart joins are not valid inside child queries - convert to a normal join.
     //The flags should already have been stripped if targetting hthor/roxie
@@ -11772,7 +11772,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityJoinOrDenormalize(BuildCtx & c
             //Possibly if KEEP(1) was added, no limits, no skipping in transform etc.
             if (isLookupJoin && !isManyLookup)
                 isAllJoin = false;
-            WARNING(HQLWRN_JoinConditionFoldedNowAll);
+            WARNING(CategoryUnusual, HQLWRN_JoinConditionFoldedNowAll);
         }
         else
         {
@@ -13976,7 +13976,7 @@ void HqlCppTranslator::checkAmbiguousRollupCondition(IHqlExpression * expr)
         OwnedHqlExpr newSelect = replaceSelector(select, dataset->queryNormalizedSelector(), queryActiveTableSelector());
         StringBuffer selectText;
         getExprECL(newSelect, selectText);
-        reportWarning(queryLocation(expr), ECODETEXT(HQLWRN_AmbiguousRollupCondition), selectText.str());
+        reportWarning(CategoryUnexpected, queryLocation(expr), ECODETEXT(HQLWRN_AmbiguousRollupCondition), selectText.str());
     }
 }
 
@@ -15287,7 +15287,7 @@ void HqlCppTranslator::buildLimitHelpers(BuildCtx & ctx, IHqlExpression * rowLim
     doBuildUnsigned64Function(ctx, "getRowLimit", rowLimit);
 
     if (isZero(rowLimit))
-        WARNING(HQLWRN_LimitIsZero);
+        WARNING(CategoryUnusual, HQLWRN_LimitIsZero);
 
     if (!isSkip)
     {

+ 2 - 2
ecl/hqlcpp/hqlnlp.cpp

@@ -634,7 +634,7 @@ void HqlCppTranslator::doBuildParseValidators(BuildCtx & classctx, IHqlExpressio
 void HqlCppTranslator::doBuildParseCompiled(BuildCtx & classctx, MemoryBuffer & buffer)
 {
     if (buffer.length() > 1000000)
-        WARNING1(HQLWRN_ParseVeryLargeDefinition, buffer.length());
+        WARNING1(CategoryEfficiency, HQLWRN_ParseVeryLargeDefinition, buffer.length());
 
     BuildCtx funcctx(classctx);
 
@@ -723,7 +723,7 @@ ABoundActivity * HqlCppTranslator::doBuildActivityParse(BuildCtx & ctx, IHqlExpr
     nlpParse->compileSearchPattern();
     nlpParse->queryParser()->serialize(buffer);
     if (nlpParse->isGrammarAmbiguous())
-        WARNING1(HQLWRN_GrammarIsAmbiguous, instance->activityId);
+        WARNING1(CategoryEfficiency, HQLWRN_GrammarIsAmbiguous, instance->activityId);
 
     doBuildParseCompiled(instance->classctx, buffer);
     updateTimer("workunit;Generate PARSE: Compile", msTick()-startCompileTime);

+ 6 - 6
ecl/hqlcpp/hqlsource.cpp

@@ -2016,7 +2016,7 @@ void SourceBuilder::buildKeyedLimitHelper(IHqlExpression * self)
         func1ctx.addQuotedCompound("virtual unsigned __int64 getKeyedLimit()");
         translator.buildReturn(func1ctx, limitValue);
         if (isZero(limitValue))
-            translator.WARNING(HQLWRN_KeyedLimitIsZero);
+            translator.WARNING(CategoryUnusual, HQLWRN_KeyedLimitIsZero);
 
         LinkedHqlExpr fail = keyedLimitExpr->queryChild(2);
         if (!fail || fail->isAttribute())
@@ -4637,7 +4637,7 @@ void MonitorExtractor::buildKeySegment(BuildMonitorState & buildState, BuildCtx
                         translator.throwError3(HQLERR_KeyedFollowsGap, getExprECL(field, s).str(), buildState.implicitWildField->queryChild(1)->queryName()->str(), queryKeyName(keyname));
                     else if (!buildState.doneImplicitWarning)
                     {
-                        translator.WARNING3(HQLWRN_KeyedFollowsGap, getExprECL(field, s).str(), buildState.implicitWildField->queryChild(1)->queryName()->str(), queryKeyName(keyname));
+                        translator.WARNING3(CategoryEfficiency, HQLWRN_KeyedFollowsGap, getExprECL(field, s).str(), buildState.implicitWildField->queryChild(1)->queryName()->str(), queryKeyName(keyname));
                         buildState.doneImplicitWarning = true;
                     }
                 }
@@ -4647,7 +4647,7 @@ void MonitorExtractor::buildKeySegment(BuildMonitorState & buildState, BuildCtx
     if (buildState.wildWasKeyed && (matches.ordinality() == 0))
     {
         StringBuffer keyname;
-        translator.WARNING2(HQLWRN_FoldRemoveKeyed, field->queryName()->str(), queryKeyName(keyname));
+        translator.WARNING2(CategoryFolding, HQLWRN_FoldRemoveKeyed, field->queryName()->str(), queryKeyName(keyname));
     }
 
     StringBuffer s;
@@ -4664,7 +4664,7 @@ void MonitorExtractor::buildKeySegment(BuildMonitorState & buildState, BuildCtx
             else
             {
                 StringBuffer keyname;
-                translator.WARNING2(HQLERR_OptKeyedFollowsWild, getExprECL(field, s).str(), queryKeyName(keyname));
+                translator.WARNING2(CategoryEfficiency, HQLERR_OptKeyedFollowsWild, getExprECL(field, s).str(), queryKeyName(keyname));
             }
         }
         //previous condition folded so always true, so keyed,opt will always be a wildcard.
@@ -6201,9 +6201,9 @@ void IndexReadBuilderBase::buildMembers(IHqlExpression * expr)
         {
             StringBuffer keyname;
             if (implicitLimit)
-                translator.WARNINGAT2(queryLocation(expr), HQLWRN_ImplicitReadAddLimit, implicitLimit, monitors.queryKeyName(keyname));
+                translator.WARNINGAT2(CategoryLimit, queryLocation(expr), HQLWRN_ImplicitReadAddLimit, implicitLimit, monitors.queryKeyName(keyname));
             else
-                translator.WARNINGAT1(queryLocation(expr), HQLWRN_ImplicitReadLimit, monitors.queryKeyName(keyname));
+                translator.WARNINGAT1(CategoryLimit, queryLocation(expr), HQLWRN_ImplicitReadLimit, monitors.queryKeyName(keyname));
         }
 
         if (implicitLimit)

+ 11 - 10
ecl/hqlcpp/hqlttcpp.cpp

@@ -296,7 +296,7 @@ void NewThorStoredReplacer::doAnalyseBody(IHqlExpression * expr)
             StringBuffer nameText,valueText;
             name->getStringValue(nameText);
             if (isOptionTooLate(nameText.str()))
-                translator.reportWarning(HQLWRN_OptionSetToLate, HQLWRN_OptionSetToLate_Text, nameText.str());
+                translator.reportWarning(CategoryIgnored, HQLWRN_OptionSetToLate, HQLWRN_OptionSetToLate_Text, nameText.str());
 
             if (value->queryType()->getTypeCode() == type_boolean)
                 valueText.append(value->getBoolValue() ? 1 : 0);
@@ -1371,7 +1371,7 @@ IHqlExpression * SequenceNumberAllocator::createTransformed(IHqlExpression * exp
     case no_outputscalar:
         if (applyDepth)
         {
-            translator.WARNINGAT(expr, HQLERR_ScalarOutputWithinApply);
+            translator.WARNINGAT(CategoryUnexpected, expr, HQLERR_ScalarOutputWithinApply);
         }
         break;
     }
@@ -2225,7 +2225,7 @@ IHqlExpression * ThorHqlTransformer::normalizeRollup(IHqlExpression * expr)
 
             if (equalities.ordinality() == 0)
             {
-                translator.reportWarning(queryLocation(expr), ECODETEXT(HQLWRN_AmbiguousRollupNoGroup));
+                translator.reportWarning(CategoryEfficiency, queryLocation(expr), ECODETEXT(HQLWRN_AmbiguousRollupNoGroup));
             }
             else
             {
@@ -5652,7 +5652,7 @@ IHqlExpression * WorkflowTransformer::extractWorkflow(IHqlExpression * untransfo
                         throwError1(HQLERR_DuplicateDefinitionDiffType, s.str());
                 }
                 else if (translator.queryOptions().allowStoredDuplicate)            // only here as a temporary workaround
-                    translator.reportWarning(queryActiveLocation(expr), HQLERR_DuplicateDefinition, HQLERR_DuplicateDefinition_Text, s.str());
+                    translator.reportWarning(CategoryMistake, queryActiveLocation(expr), HQLERR_DuplicateDefinition, HQLERR_DuplicateDefinition_Text, s.str());
                 else
                 {
                     if (queryLocationIndependent(prevValue) != queryLocationIndependent(value))
@@ -6589,7 +6589,7 @@ void WorkflowTransformer::analyseExpr(IHqlExpression * expr)
                 if (expr->queryName())
                     s.appendf(" '%s'", expr->queryName()->str());
                 //MORE: Better if we also kept nested track of locations
-                translator.WARNINGAT1(queryActiveLocation(expr), HQLWRN_WorkflowSeemsToBeDependent, s.str());
+                translator.WARNINGAT1(CategoryMistake, queryActiveLocation(expr), HQLWRN_WorkflowSeemsToBeDependent, s.str());
             }
 
             unsigned prevWfid = activeWfid;
@@ -7383,9 +7383,9 @@ IHqlExpression * ExplicitGlobalTransformer::createTransformed(IHqlExpression * e
                             s.append(" in ").append(symbol->queryName());
                     }
                     if (op == no_nothor)
-                        translator.reportWarning(queryActiveLocation(expr), ECODETEXT(HQLWRN_NoThorContextDependent), s.str());
+                        translator.reportWarning(CategoryMistake, queryActiveLocation(expr), ECODETEXT(HQLWRN_NoThorContextDependent), s.str());
                     else
-                        translator.reportWarning(queryActiveLocation(expr), ECODETEXT(HQLWRN_GlobalDoesntSeemToBe), s.str());
+                        translator.reportWarning(CategoryMistake, queryActiveLocation(expr), ECODETEXT(HQLWRN_GlobalDoesntSeemToBe), s.str());
                 }
                 if (value->getOperator() == no_createset)
                 {
@@ -7502,7 +7502,7 @@ protected:
                 StringBuffer s;
                 if (filename)
                     getExprECL(filename, s);
-                translator.WARNINGAT1(queryActiveLocation(expr), HQLWRN_OutputDependendOnScope, s.str());
+                translator.WARNINGAT1(CategoryMistake, queryActiveLocation(expr), HQLWRN_OutputDependendOnScope, s.str());
 
     #if 0
                 checkIndependentOfScope(expr);
@@ -7512,7 +7512,7 @@ protected:
         default:
             if (!isIndependentOfScope(expr))
             {
-                translator.WARNINGAT(queryActiveLocation(expr), HQLWRN_GlobalActionDependendOnScope);
+                translator.WARNINGAT(CategoryMistake, queryActiveLocation(expr), HQLWRN_GlobalActionDependendOnScope);
 
     #if 0
                 checkIndependentOfScope(expr);
@@ -10327,7 +10327,8 @@ IHqlExpression * NestedCompoundTransformer::createTransformed(IHqlExpression * e
                     //MORE: This should be an error, but there are still occasional false positives e.g., OUTPUT(ds1.childds)
                     //so needs to stay a warning.
 //                  translator.ERRORAT1(location, HQLERR_GlobalSideEffectDependent, s.str());
-                    translator.WARNINGAT1(location, HQLWRN_GlobalSideEffectDependent, s.str());
+                    //GH: Make this a default error severity
+                    translator.WARNINGAT1(CategoryMistake, location, HQLWRN_GlobalSideEffectDependent, s.str());
                 }
                 break;
             }