Changes between Version 22 and Version 23 of Guidelines/WarningsGuidelines


Ignore:
Timestamp:
Sep 8, 2011, 8:34:48 AM (11 years ago)
Author:
Paul A. Bristow
Comment:

C4100 and Doxygen \param

Legend:

Unmodified
Added
Removed
Modified
  • Guidelines/WarningsGuidelines

    v22 v23  
    263263
    264264||Warning||Warning Description||Suggestions||Suppression||
    265 ||C4100|| unreferenced formal parameter||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.||#  pragma warning(disable: 4100) // 'name' : unreferenced formal parameter||
     265||C4100|| unreferenced formal parameter||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. (If you comment out, you will not be able to document the parameters using Doxygen \param my_variable, so you will need to disable the warning)||#  pragma warning(disable: 4100) // 'name' : unreferenced formal parameter||
    266266||C4127|| conditional expression is constant||Very common and many believe unhelpful, but a few find it informative, so do not suppress globally.  Even while(true) can trigger this!  Suppress. while(true) can be rewritten as for(;;) eliminating the warning. || #  pragma warning(disable: 4127) // conditional expression is constant.||
    267267||C4146|| unary minus operator applied to unsigned type, result still unsigned||This indicates a real error. ||Fix. ||