Pointless uninitialized warning with indirect exception
Original Reporter info from Mantis: BeniBela @benibela
-
Reporter name: Benito van der Zander
Original Reporter info from Mantis: BeniBela @benibela
- Reporter name: Benito van der Zander
Description:
There is a pointless uninitialized warning when calling a function that never returns
Steps to reproduce:
procedure throw;
begin
raise Exception.Create('foo');
end;
function invertsome(c: boolean): boolean;
begin //project3.lpr(44,1) Warning: Function result variable does not seem to be initialized
if c = true then result := false
else throw
end;
Additional information:
It is a common pattern to move the raise statement to a helper function, so you can construct an error message there, because constructing the message in the main function would give a pointless implicit exception frame there
Mantis conversion info:
- Mantis ID: 34800
- OS: linux
- OS Build: opensuse
- Build: r40681
- Platform: amd64
- Version: 3.3.1
- Monitored by: » Fr0sT (Fr0sT)