Browse Source

Added warning for ignored return values of procedure calls with Windows calling convention as a preparation for removing this legacy behaviour altogether

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8411 8c9fc860-2736-0410-a75d-ab315db34111
negelef 6 năm trước cách đây
mục cha
commit
edddf2e9e0
1 tập tin đã thay đổi với 7 bổ sung3 xóa
  1. 7 3
      source/FoxSemanticChecker.Mod

+ 7 - 3
source/FoxSemanticChecker.Mod

@@ -7483,9 +7483,13 @@ TYPE
 				(* inline call in a statement *)
 			ELSIF ~IsCallable(call) THEN
 				Error(procedureCall.position,"called object is not a procedure");
-			ELSIF (call.type # NIL) &  (call.left # NIL) &  (call.left.type.resolved(SyntaxTree.ProcedureType).callingConvention # SyntaxTree.WinAPICallingConvention) THEN
-				Error(procedureCall.position,"calling procedure with non-void return type");
-				IF VerboseErrorMessage THEN Printout.Info("call ",call) END;
+			ELSIF (call.type # NIL) &  (call.left # NIL) THEN
+				IF call.left.type.resolved(SyntaxTree.ProcedureType).callingConvention = SyntaxTree.WinAPICallingConvention THEN
+					Warning(procedureCall.position,"ignoring return value of procedure call");
+				ELSE
+					Error(procedureCall.position,"calling procedure with non-void return type");
+					IF VerboseErrorMessage THEN Printout.Info("call ",call) END;
+				END;
 			END;
 			procedureCall.SetCall(call);