array index out of bound may not throw exception?

2023-07-21 Thread mw via Digitalmars-d-learn
So my question: array index out of bound may not throw exception in D? I tried DMD and LDC, both have this problem. Is there any flag I can pass to the compiler to let it always throw exception? Thanks.

Re: array index out of bound may not throw exception?

2023-07-21 Thread Jonathan M Davis via Digitalmars-d-learn
ich is much > harder to debug (than exception which tells the exact error and > source line location). > > So my question: array index out of bound may not throw exception > in D? > > I tried DMD and LDC, both have this problem. > > Is there any flag I can pass to the compi

Re: array index out of bound may not throw exception?

2023-07-21 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 21 July 2023 at 21:27:45 UTC, mw wrote: However, I just debugged a case, where out of bound array index didn't throw exception, and just hang the thread Uncaught exceptions in a thread terminate that thread and are reported when you call the `join` method of the thread. I think yo

Re: array index out of bound may not throw exception?

2023-07-21 Thread mw via Digitalmars-d-learn
On Friday, 21 July 2023 at 23:32:41 UTC, Adam D Ruppe wrote: On Friday, 21 July 2023 at 21:27:45 UTC, mw wrote: However, I just debugged a case, where out of bound array index didn't throw exception, and just hang the thread Uncaught exceptions in a thread terminate that thread and are report

Re: array index out of bound may not throw exception?

2023-07-22 Thread Andrew via Digitalmars-d-learn
On Friday, 21 July 2023 at 23:40:44 UTC, mw wrote: Is there a way to let it report on the spot when it happens? The best way is to wrap your thread's main function in a try-catch block and just print whatever error/exception is caught.

Re: array index out of bound may not throw exception?

2023-07-27 Thread Kagamin via Digitalmars-d-learn
On Friday, 21 July 2023 at 23:40:44 UTC, mw wrote: Is there a way to let it report on the spot when it happens? On linux if you catch an exception and call abort, the debugger will show you where abort was called, on windows you can call DebugBreak function, the debugger will show where it wa