Prof A Olowofoyeku (The African Chief) wrote:
On 22 Feb 2005 at 17:01, Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
It seems that "{$R-}" does not work in units to turn off range checking, and that one has to use it in the main program. Is this by design?
No, this "works" for me (says 11). Can you give an example?
[...]
It works in simple programs like this. It does not work in a big and complicated program that I have, while it works in another big and complicated program. I will continue to investigate ...
Are you sure the range error occurs in the unit with `{$R-}' (not e.g., in a calling or called unit or the RTS)?
You find out, you can:
- compile the program with debug info (`-g')
- run the program (not the compiler) with `--gpc-rts=-Eerror.log' as the first option
- look the the file `error.log' after a runtime error and pipe it though `addr2line -e path-to-your-executable'
This will show the routines called at the time of error. If the one before the error handling routines (in error.pas) is also in the RTS, it might be an RTS range-check error which we'll have to fix.
Frank