I agree that it is best to clear all warnings. If you get thousands of alerts, you must prioritize your fixes.
Run your compiler to the lowest warning level. These warnings should be the most important. When they are fixed, increase the warning level and repeat until you reach the highest warning level. Then set the compilation options so that warnings are treated as errors.
If you find a warning that you suspect is safe to ignore, do some research to test your theory. Only then turn it off and only in the most minimal way. Most compilers have #pragma that can disable / enable warnings for only part of the file. Here is a Visual C ++ example:
typedef struct _X * X;
Note that this disables the warning for only one line of code. Using this method also allows you to perform a simple text search of your code in the future to make changes.
Alternatively, you can usually turn off a specific warning for a single file or for all files. IMHO this is dangerous and should be only last.
jwfearn Oct 08 '08 at 17:25 2008-10-08 17:25
source share