Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How long has EStackOverflow been deprecated and what replaces it?

I noticed that EStackOverflow, as defined in SysUtils.pas is marked as deprecated in Delphi 2009. I checked and it was also marked as deprecated in 2007. I have a Delphi 7 install disk here, but I thought I would ask if anyone knows when it was deprecated.

Additionally, does anyone know why, and what replaces it? I wrote a test application that causes a Stack Overflow through recursion, and I still get an EStackOverflow exception, but if I add a handler specifically for it then I get

[DCC Warning] Unit57.pas(85): W1000 Symbol 'EStackOverflow' is deprecated

I know that EStackOverflow descends from EExternal, and that I could trap EExternal and check ExceptionCode for STATUS_STACK_OVERFLOW, but that seems unnecessary since it still throws the EStackOverflow exception.

Is this just to discourage me from throwing an EStackOverflow in my own code?

(Yes, I realize the irony of asking a question about EStackOverflow on a website called StackOverflow, and yes I am completely serious.)

like image 419
Jim McKeeth Avatar asked Nov 12 '08 08:11

Jim McKeeth


4 Answers

I don't have D5 here to say, but I barely remember the deprecated directive appeared only on D6.

As for StackOverflow exception, I think it's deprecated because is only for Delphi runtime environment to raise it.

EDIT: Based on the aggregate of all the answers, EStackOverflow was deprecated in Delphi 6 when the Deprecated keyword was introduced.

like image 94
Fabricio Araujo Avatar answered Nov 02 '22 04:11

Fabricio Araujo


Just like in .NET, you cant really catch a StackOverflow exception, what do you recover to? Your code is most likely wrong if you need to catch one :)

like image 31
leppie Avatar answered Nov 02 '22 03:11

leppie


I just checked my Delphi 6, and EStackOverflow is already deprecated. I don't have access to older versions of Delphi here.

I can't help you with the why or the possible replacement.

like image 2
Otherside Avatar answered Nov 02 '22 04:11

Otherside


In Delphi 5 it's not yet deprecated.

edit: Actually, in Delphi 5, 'deprecated' is not a reserved word.

like image 2
Attila Szasz Avatar answered Nov 02 '22 04:11

Attila Szasz