wiki:Guidelines/Warnings/Microsoft

Version 1 (modified by Daniel James, 12 years ago) ( diff )

Demo of how microsoft warnings could be laid out.

Microsoft Warnings

C4100 - Unreferenced formal parameter

Suggestion
Either surround the parameter with C comments, for example: int /* my_variable */) or just delete if the variable name is uninformative. If in other's module(s), or you are too busy/idle, at least suppress warning. In generic code you might not be able to comment the variable name as it might actually be used to call a static function. In this case simply referencing the variable (varname;) in the function body eliminates the warning.
Suppression
# pragma warning(disable: 4100) // 'name' : unreferenced formal parameter

C4127 - Conditional expression is constant

Suggestion
Very common and many believe unhelpful, but a few find it informative, so do not suppress globally. Even while(true) can trigger this! while(true) can be rewritten as for(;;) eliminating the warning.
Suppression
# pragma warning(disable: 4127) // conditional expression is constant.
Note: See TracWiki for help on using the wiki.