Not widely known problem in programming? (Developers)
> 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:
- Not widely known problem in programming? - Laaca, 27.03.2021, 20:06 (Developers)
- Not widely known problem in programming? - ecm, 27.03.2021, 20:30
- Not widely known problem in programming? - tkchia, 28.03.2021, 08:02
- Not widely known problem in programming? - marcov, 28.03.2021, 17:44
- Not widely known problem in programming? - bretjohn, 29.03.2021, 20:03
- Not widely known problem in programming? - Laaca, 29.03.2021, 22:24
- Not widely known problem in programming? - bretjohn, 29.03.2021, 23:02
- Not widely known problem in programming? - marcov, 30.03.2021, 12:05
- Not widely known problem in programming? - bretjohn, 29.03.2021, 23:02
- Not widely known problem in programming? - ecm, 29.03.2021, 22:26
- Not widely known problem in programming? - Laaca, 29.03.2021, 22:24
- Not widely known problem in programming? - tkchia, 28.03.2021, 08:02
- Not widely known problem in programming? - ecm, 28.03.2021, 21:52
- Not widely known problem in programming? - Laaca, 29.03.2021, 05:04
- Not widely known problem in programming? - ecm, 27.03.2021, 20:30