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

View File

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