DCMTK  Version 3.6.2
OFFIS DICOM Toolkit
Macros
ofdiag.h File Reference

Defines macros for controlling compiler diagnostic output, i.e. warnings. More...

Macros

#define DCMTK_DIAGNOSTIC_PUSH   <unspecified>
 A macro for pushing a compiler diagnostic scope. More...
 
#define DCMTK_DIAGNOSTIC_POP   <unspecified>
 A macro for pop-ing a compiler diagnostic scope, restoring the parent scope. More...
 
#define DCMTK_DIAGNOSTIC_IGNORE_SIGN_COMPARE   <unspecified>
 A macro to disable warnings about comparing signed with unsigned values. More...
 
#define DCMTK_DIAGNOSTIC_IGNORE_OVERFLOW   <unspecified>
 A macro to disable warnings about overflowing constant expressions. More...
 
#define DCMTK_DIAGNOSTIC_IGNORE_MISMATCHED_TAGS   <unspecified>
 A macro to disable warnings about mixing the keywords struct and class. More...
 
#define DCMTK_DIAGNOSTIC_IGNORE_PREDEFINED_IDENTIFIER_OUTSIDE_FUNCTION   <unspecified>
 A macro to disable warnings about using __func__ etc. outside of a function. More...
 
#define DCMTK_DIAGNOSTIC_IGNORE_IMPLICIT_CONVERSION   <unspecified>
 A macro to disable warnings about implicit type conversions that may alter the value. More...
 
#define DCMTK_DIAGNOSTIC_IGNORE_SHADOW   <unspecified>
 A macro to disable warnings about variable/type name shadowing. More...
 
#define DCMTK_DIAGNOSTIC_IGNORE_NO_SUITABLE_DEFINITION_FOR_TEMPLATE_INSTANTIATION   <unspecified>
 A macro to disable a Visual Studio specific warning about explicit template instantiation. More...
 
#define DCMTK_DIAGNOSTIC_IGNORE_VISUAL_STUDIO_PERFORMANCE_WARNING   <unspecified>
 A macro to disable the Visual Studio specific "performance warning" about implicit conversion to a boolean value. More...
 

Detailed Description

Defines macros for controlling compiler diagnostic output, i.e. warnings.

Macro Definition Documentation

◆ DCMTK_DIAGNOSTIC_IGNORE_IMPLICIT_CONVERSION

#define DCMTK_DIAGNOSTIC_IGNORE_IMPLICIT_CONVERSION   <unspecified>

A macro to disable warnings about implicit type conversions that may alter the value.

Note
The macro may only be used in conjunction with #include!
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_IGNORE_MISMATCHED_TAGS

#define DCMTK_DIAGNOSTIC_IGNORE_MISMATCHED_TAGS   <unspecified>

A macro to disable warnings about mixing the keywords struct and class.

Note
The macro may only be used in conjunction with #include!
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_IGNORE_NO_SUITABLE_DEFINITION_FOR_TEMPLATE_INSTANTIATION

#define DCMTK_DIAGNOSTIC_IGNORE_NO_SUITABLE_DEFINITION_FOR_TEMPLATE_INSTANTIATION   <unspecified>

A macro to disable a Visual Studio specific warning about explicit template instantiation.

Note
The macro may only be used in conjunction with #include!
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_IGNORE_OVERFLOW

#define DCMTK_DIAGNOSTIC_IGNORE_OVERFLOW   <unspecified>

A macro to disable warnings about overflowing constant expressions.

Note
The macro may only be used in conjunction with #include!
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_IGNORE_PREDEFINED_IDENTIFIER_OUTSIDE_FUNCTION

#define DCMTK_DIAGNOSTIC_IGNORE_PREDEFINED_IDENTIFIER_OUTSIDE_FUNCTION   <unspecified>

A macro to disable warnings about using __func__ etc. outside of a function.

Note
The macro may only be used in conjunction with #include!
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_IGNORE_SHADOW

#define DCMTK_DIAGNOSTIC_IGNORE_SHADOW   <unspecified>

A macro to disable warnings about variable/type name shadowing.

Note
The macro may only be used in conjunction with #include!
Remarks
This warning is typically helpful to prevent unintended behavior, however, small structs often have members with matching names as constructor arguments (for consistent use/assignment). It makes sense to suppress this warning in that case.
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_IGNORE_SIGN_COMPARE

#define DCMTK_DIAGNOSTIC_IGNORE_SIGN_COMPARE   <unspecified>

A macro to disable warnings about comparing signed with unsigned values.

Note
The macro may only be used in conjunction with #include!
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_IGNORE_VISUAL_STUDIO_PERFORMANCE_WARNING

#define DCMTK_DIAGNOSTIC_IGNORE_VISUAL_STUDIO_PERFORMANCE_WARNING   <unspecified>

A macro to disable the Visual Studio specific "performance warning" about implicit conversion to a boolean value.

Note
The macro may only be used in conjunction with #include!
Remarks
The warning was meant to indicate that a non boolean value should probably be stored as a boolean value in the first place, instead of using an integer (i.e. when C programmers do C++). However, that is hardly ever the case and it is mostly and annoyingly emitted in perfectly fine code that checks if a value is not equal to zero etc., therefore, suppressing it is usually appropriate.
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_POP

#define DCMTK_DIAGNOSTIC_POP   <unspecified>

A macro for pop-ing a compiler diagnostic scope, restoring the parent scope.

Note
The macro may only be used in conjunction with #include!
See also
DCMTK_DIAGNOSTIC_PUSH for an example.

◆ DCMTK_DIAGNOSTIC_PUSH

#define DCMTK_DIAGNOSTIC_PUSH   <unspecified>

A macro for pushing a compiler diagnostic scope.

Note
The macro may only be used in conjunction with #include!

If the compiler supports diagnostic scopes, using this macro will create a new one inside which warning messages might be disabled selectively. The macro will have no effect if the compiler does not support diagnostic scopes.

Remarks
Currently supported compilers are GCC (version 4.6 and later, including derivates like MinGW), Clang and Visual Studio.

Example

int i = 3;
unsigned ui = 8;
// will potentially emit a warning, although perfectly safe
if( i < ui )
doStuff();
// create a new diagnostic scope
#include DCMTK_DIAGNOSTIC_PUSH
// disable the sign mismatch warning
#include DCMTK_DIAGNOSTIC_IGNORE_SIGN_COMPARE
// the warning is omitted!
if( i < ui )
doStuff();
// restore the parent diagnostic scope potentially enabling
// the sign mismatch warning again
#include DCMTK_DIAGNOSTIC_POP


Generated on Mon Jul 17 2017 for DCMTK Version 3.6.2 by Doxygen 1.8.13