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.

7 Responses to “Debugging”

  1. Sjors Gielen Says:

    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 😦

  2. damian Says:

    haha it took me a few seconds to realize that.

  3. GIrish Says:

    Don’t ignore compiler warnings 🙂

    • Stefan Majewsky Says:

      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.

  4. Anonymous Says:

    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.

  5. deorbit Says:

    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? 🙂

  6. Zack Says:

    noticed this blog as one of the fastest growing wordpress blogs. noice.

    and i chuckled when I saw that. silly little errors. : )


Leave a reply to deorbit Cancel reply