Why is this global declared...
That surprisingly is the first thing that popped into my head after reading this worse than failure entry...
You might ask "why". Well, it made me remember this conversation I had with a developer about 15 or 16 years ago:
me: Why is this global declared - it isn't used.
them: because if you remove it, the program will crash.
me: you mean it won't compile because it really is used?
them: no, it compiles cleanly with or without it - but there must be a bug in the compiler because if you remove the global variable - the program segmentation faults and dumps core
me: do you understand what you have really done here? You have a memory overwrite and you are just hiding it by having this big variable stuck in there - you have a bug in your code.
them: how could it be a bug in my code, my code runs - as long as the variable is defined. it must be the compiler.
It was not a good day :) We spent the rest of the week removing unused globals and local stack variables - fixing memory overwrite after memory overwrite in the process. They really blamed the compiler.
I miss my old C programming days, they were fun (really)...










