Changes between Version 8 and Version 9 of Guidelines/WarningsGuidelines


Ignore:
Timestamp:
Jan 8, 2011, 12:29:18 PM (12 years ago)
Author:
Paul A. Bristow
Comment:

Added warning as errors from Pete Bartlett

Legend:

Unmodified
Added
Removed
Modified
  • Guidelines/WarningsGuidelines

    v8 v9  
    157157}}}
    158158
    159 Using warning-as-errors will make it hard to miss warnings.
    160   Microsoft command line option /WX,
     159'''Defining warnings as errors'''
     160
     161  Using warning-as-errors will make it hard to miss or ignore warnings.
     162  Microsoft command line option /WX, makes all warnings errors, but this may be too drastic a step.
     163
     164  The following have been recommended by Pete Bartlett to make the MSVC and GCC compilers behave as similarly as possible:
     165
     166  /we4288 - For-loop scoping (this is the default)
     167
     168  /we4238 - don't take address of temporaries
     169
     170  /we4239 - don't bind temporaries to non-const references (Stephan's "Evil Extension")
     171
     172  /we4346 - require "typename" where the standard requires it.
     173
     174and compile options:
     175
     176  /Zc:forScope - For loop scoping again (this is the default).
     177
     178  /DNOMINMAX - Don't define min/max macros (usually only applies if windows.h is involved).
     179  (Note that suitable bracketing, for example, (std::numeric_limits<result_type>::max)(), will avoid clashes with min/max macros, and is required to avoid being named'n'shamed by the Boost inspection program. So it may be better to check that clashes are correctly avoided by bracketing because others may use when min/max macros are defined rather than using this compiler option.)
     180
    161181  gcc option -warning-as-errors
    162182  gcc option -pedantic-errors
     
    255275||C4996||'  this item is deprecated.||Many similar messages suggest using secure versions. Unless you strongly believe that the 'secure' versions are useful, suppress. [http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1160.pdf WG14 Austin Group concerns] may guide. See also _CRT_SECURE_NO_DEPRECATE and other defines above.||#  pragma warning(disable: 4996) // '' was declared deprecated.||
    256276||C6385||invalid data: accessing <buffer name>, the readable size is <size1> bytes, but <size2> bytes may be read.||Code analyser False warning C6385 when a function result is used as an array index. See [https://connect.microsoft.com/VisualStudio/feedback/details/281033/] suggests this can be suppressed, unless a check on array bounds is wanted/necessary.||
     277
    257278
    258279'''GCC'''
     
    634655}}}
    635656
    636    
    637 
    638 
    639 
    640 
    641 
    642  |? || class does not have a  virtual destructor||Suppress or provide a virtual destructor.||??||
     657
     658
     659||?||class does not have a  virtual destructor||Suppress or provide a virtual destructor.||??||
    643660
    644661'''Intel'''