diff --git a/compiler/constexp.pas b/compiler/constexp.pas index adb60758e5..3bb78a7092 100644 --- a/compiler/constexp.pas +++ b/compiler/constexp.pas @@ -41,7 +41,7 @@ type Tconstexprint=record build trouble when compiling the directory utils, since the cpu directory isn't searched there. Therefore we use a procvar and make verbose install the errorhandler. A dependency from verbose on this unit is no problem.} -var internalerror:errorproc; +var internalerrorproc:errorproc; {Same issue, avoid dependency on cpuinfo because the cpu directory isn't searched during utils building.} @@ -87,7 +87,14 @@ function tostr(const i:Tconstexprint):shortstring;overload; implementation {****************************************************************************} +{ use a separate procedure here instead of calling internalerrorproc directly because + - procedure variables cannot have a noreturn directive + - having a procedure and a procedure variable with the same name in the interfaces of different units is confusing } +procedure internalerror(i:longint);{$ifndef VER2_6}noreturn;{$endif VER2_6} +begin + internalerrorproc(i); +end; operator := (const u:qword):Tconstexprint; diff --git a/compiler/optloop.pas b/compiler/optloop.pas index f3be045b48..3b848ab96e 100644 --- a/compiler/optloop.pas +++ b/compiler/optloop.pas @@ -36,6 +36,7 @@ unit optloop; uses cutils,cclasses, globtype,globals,constexp, + verbose, symdef,symsym, defutil, cpuinfo, diff --git a/compiler/verbose.pas b/compiler/verbose.pas index f38af4aabd..22f73ae1d9 100644 --- a/compiler/verbose.pas +++ b/compiler/verbose.pas @@ -89,7 +89,7 @@ interface function ErrorCount:longint; procedure SetErrorFlags(const s:string); procedure GenerateError; - procedure Internalerror(i:longint); + procedure Internalerror(i:longint);{$ifndef VER2_6}noreturn;{$endif VER2_6} procedure Comment(l:longint;s:ansistring); function MessagePchar(w:longint):pchar; procedure Message(w:longint;onqueue:tmsgqueueevent=nil); @@ -538,7 +538,7 @@ implementation { Enable writing of notes, to avoid getting errors without any message } status.verbosity:=status.verbosity or V_Note; end; - + end; 'h','H' : begin @@ -565,7 +565,7 @@ implementation end; - procedure internalerror(i : longint); + procedure internalerror(i : longint);{$ifndef VER2_6}noreturn;{$endif VER2_6} begin UpdateStatus; do_internalerror(i); @@ -1017,7 +1017,7 @@ implementation initialization - constexp.internalerror:=@internalerror; + constexp.internalerrorproc:=@internalerror; finalization { Be sure to close the redirect files to flush all data } DoneRedirectFile;