IDE: Recognize warnings from unknown compiler messages.

This commit is contained in:
Juha 2022-12-03 22:50:40 +02:00
parent 3c5ebb53bb
commit 0db4149e93
2 changed files with 7 additions and 2 deletions

View File

@ -58,6 +58,7 @@ type
TCompiler = class(TObject)
private
FOnCmdLineCreate : TOnCmdLineCreate;
procedure WriteError(const Msg: string);
public
constructor Create;
destructor Destroy; override;
@ -65,7 +66,6 @@ type
const WorkingDir, CompilerFilename, CompilerParams: string;
BuildAll, SkipLinking, SkipAssembler, CurrentDirectoryIsTestDir: boolean;
const aCompileHint: string): TModalResult;
procedure WriteError(const Msg: string);
end;
// Following classes are for compiler options parsed from "fpc -h" and "fpc -i".

View File

@ -1565,12 +1565,17 @@ end;
function TIDEFPCParser.CheckForUnspecificStdErr(p: PChar): boolean;
var
MsgLine: TMessageLine;
s: string;
begin
if not fMsgIsStdErr then exit(false);
Result:=true;
MsgLine:=CreateMsgLine;
MsgLine.SubTool:=SubToolFPC;
MsgLine.Urgency:=mluError;
s:=p;
if Pos('warning',s)>0 then
MsgLine.Urgency:=mluWarning
else
MsgLine.Urgency:=mluError;
MsgLine.Msg:=p;
AddMsgLine(MsgLine);
end;