* make use of the noreturn directive for internalerror

* clean up of the internalerror procedure variable in the constexp unit

git-svn-id: trunk@26004 -
This commit is contained in:
florian 2013-11-10 09:01:03 +00:00
parent 1d4a4d0684
commit a0f0d0de40
3 changed files with 13 additions and 5 deletions

View File

@ -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;

View File

@ -36,6 +36,7 @@ unit optloop;
uses
cutils,cclasses,
globtype,globals,constexp,
verbose,
symdef,symsym,
defutil,
cpuinfo,

View File

@ -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;