Thread overview
classes: Error and Exception
Sep 06, 2004
Martin
Sep 06, 2004
Martin
Sep 07, 2004
Russ Lewis
Sep 10, 2004
Walter
September 06, 2004
The following gives "segmentation fault", but maybe it should throw an excetion like running out of array limits? I I think that it is almost as common mistake as running out of array bounds.


What do you think about this?

class Ca{
public:
int b;
}

int main(){
Ca a;
try{
a.b=1;
}
catch(Exception e){
printf("ERROR!\n");

}
return 0;
}


September 06, 2004
your code works for me.  i run it and it says ERROR!

i'm using windows though.  i suppose you're using linux?


September 06, 2004
Interesting, that means, that in Windows D can catch "Segmentation faults", but in linux not.

Is it so Walter?

In article <chhv3b$1ess$1@digitaldaemon.com>, Jarrett Billingsley says...
>
>your code works for me.  i run it and it says ERROR!
>
>i'm using windows though.  i suppose you're using linux?
>
>


September 07, 2004
Martin wrote:
> Interesting, that means, that in Windows D can catch "Segmentation faults", but
> in linux not.
> 
> Is it so Walter?

This is a known bug/missing feature on Linux.  I'm pretty sure that Walter intends to implement this.

Of course, if one of us writes some good example code for him, then it would be much easier for him...

September 10, 2004
"Russ Lewis" <spamhole-2001-07-16@deming-os.org> wrote in message news:chl3eq$2ru9$1@digitaldaemon.com...
> Martin wrote:
> > Interesting, that means, that in Windows D can catch "Segmentation
faults", but
> > in linux not.
> >
> > Is it so Walter?
>
> This is a known bug/missing feature on Linux.  I'm pretty sure that Walter intends to implement this.
>
> Of course, if one of us writes some good example code for him, then it would be much easier for him...

My experience on low level coding for linux is pretty limited. If someone wants to donate the code for linux that will convert seg faults into exceptions, like the Windows code does in internal\deh.c, I'd love to incorporate it.