Thursday, June 18, 2009

Compiler Warnings - Fixed & Silenced

I met many programmers that just hate them. In some cases they don't even bother to take look at them. I take them seriously. They are indicators of possible bugs. Bugs that you only see at runtime.

I always check them. If the compiler is right just fix it. It it's an false positive, silent it. There are many techniques to silent false positive compiler warnings. Just pick the right one.

When I compile someone else's program and see a lot of warnings, some questions always come to my mind: "Why didn't the programmer fixed this? Did he/she at least take a look? Did he/she take a look and didn't understood the problem? ... ".

Today I fixed and silenced all GCC warnings I saw.

No comments:

Post a Comment