I had to share this:
I was hanged for 2 full days for the next trivial error related to the Conditional Operator.
This is an easy correction, but I would like to know:
- Why compilation of error codes?
- What happened with the error?
- Why is it so hard to trace?
error code:
std::map<int, some_class> my_map; int key_ctr = 0;
Clearly, I wrote the Conditional statement incorrectly. Eveyrthing works fine when I finally found and fixed this error:
correct code:
std::map<int, some_class> my_map; int key_ctr = 0;
My program just hung when it approached the buggy part - as if it were in an endless loop. When I ran it with valgrind , I got stuff like
.... ==24570== Warning: set address range perms: large range [0x1a7731000, 0x1c5f79000) (defined) ==24570== Warning: set address range perms: large range [0x1c5f79000, 0x1e47c1000) (defined) ==24570== Warning: set address range perms: large range [0x1e47c1000, 0x203009000) (defined) ==24570== Warning: set address range perms: large range [0x203009000, 0x221851000) (defined) ..... ==3733== More than 10000000 total errors detected. I'm not reporting any more.
It was completely useless and pointed to me in the wrong director (I thought I allocated too much heap).
Yet again,
- Why compilation of error codes?
- What happened with the error?
- Why is it so hard to trace?
Thanks to the children.
source share