Debugging
September 9, 2010
I just debugged my OpenAL test program for over an hour, and still had not figured out why it would not play the sound file I gave it. Until I saw this line:
const int volume = 0.9;
And I thought that I was at a point in my life where I won’t make these silly errors anymore.
September 9, 2010 at 23:13
I once debugged an application for three hours, until I found out that someone elsewhere had re#defined fopen to be fopen_with_path_rewrite or something like that.
stat() would return no error, and fopen() would give file not found for the same filename. It was hours later when I finally noticed 😦
September 10, 2010 at 00:55
haha it took me a few seconds to realize that.
September 10, 2010 at 04:06
Don’t ignore compiler warnings 🙂
September 10, 2010 at 07:33
I won’t, but I also do not usually increase the warning level beyond what CMake deems appropriate. This did not give me a warning.
September 10, 2010 at 10:39
Use the compiler’s help (-Wall -Werror -Wextra for gcc) as much as possible. Understand the warnings and fix them. Don’t just make changes to silence the warnings. It will save on debug time and the final code will have better quality.
October 30, 2010 at 18:24
Lol, it is annoying with these ‘one-line-bugs’.
I searched my code for two days before realizing that a method, init(), got called twice, once in base class constructor and once in derived class constructor.
Solution to the bug thus was to add // at the right place.
Also, regarding sound, the volume is often a problem. Who hasn’t forgot to adjust the sound card volume and spent considerable time looking for errors? 🙂
November 1, 2010 at 21:04
noticed this blog as one of the fastest growing wordpress blogs. noice.
and i chuckled when I saw that. silly little errors. : )