views:

691

answers:

5

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.)

+1  A: 

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.

Otherside
+1  A: 

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

More importantly, I think this means you should not design code to depend on it being thrown in future versions.

Argalatyr
+1  A: 

In Delphi 5 it's not yet deprecated.

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

atika
+2  A: 

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.

Fabricio Araujo
+1  A: 

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 :)

leppie
I actually want to have a line that says "on EStackOverflow do raise;" so I don't catch it. But you may be right. Instead I decided to trap EExternal and check ExceptionCode for STATUS_STACK_OVERFLOW
Jim McKeeth