Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Not widely known problem in programming? (Developers)

posted by Laaca Homepage, Czech republic, 29.03.2021, 22:24

> You simply cannot reference a local variable from a different local procedure and expect it to be reliable (sometimes it will
> work and other times it won't).

Sure. As I said - in such trivial example it is obvious but in the real world can be difficult do find such bug because debugger does not help you with it much.
The point is whether the modern compilers (like DJGPP/GCC or Freepascal) do offer some help with this.
For example Freepascal has a compiler parameter "-gt"
What does the documentation say about this:
"-gt Trash local variables. This writes a random value to local variables at procedure start. This can be used to detect uninitialized variables."

Nice. But is does not help with my bug. However if the local variable trashing would be in the procedure ending it could maybe help.

---
DOS-u-akbar!

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 182 users online (0 registered, 182 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum