A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
Compiler warnings

Macros useful to silence compiler warnings on selected code parts. More...

+ Collaboration diagram for Compiler warnings:

Macros

#define NS_WARNING_POP
 Pops the diagnostic warning list from the stack, restoring it to the previous state.
 
#define NS_WARNING_PUSH
 Push the diagnostic warning list to the stack, allowing it to be restored later.
 
#define NS_WARNING_PUSH_DEPRECATED
 Save the current warning list and disables the ones about deprecated functions and classes.
 
#define NS_WARNING_PUSH_MAYBE_UNINITIALIZED
 Save the current warning list and disables the ones about possible uninitialized variables.
 
#define NS_WARNING_SILENCE_DEPRECATED
 Silences the "-Wdeprecated-declarations" warnings.
 
#define NS_WARNING_SILENCE_MAYBE_UNINITIALIZED
 Silences GCC "-Wmaybe-uninitialized" warnings.
 

Detailed Description

Macros useful to silence compiler warnings on selected code parts.

Macro Definition Documentation

◆ NS_WARNING_POP

#define NS_WARNING_POP

Pops the diagnostic warning list from the stack, restoring it to the previous state.

See also
NS_WARNING_PUSH

Definition at line 113 of file warnings.h.

◆ NS_WARNING_PUSH

#define NS_WARNING_PUSH

Push the diagnostic warning list to the stack, allowing it to be restored later.

See also
NS_WARNING_POP

Definition at line 111 of file warnings.h.

◆ NS_WARNING_PUSH_DEPRECATED

#define NS_WARNING_PUSH_DEPRECATED
Value:
#define NS_WARNING_PUSH
Push the diagnostic warning list to the stack, allowing it to be restored later.
Definition: warnings.h:111
#define NS_WARNING_SILENCE_DEPRECATED
Silences the "-Wdeprecated-declarations" warnings.
Definition: warnings.h:112

Save the current warning list and disables the ones about deprecated functions and classes.

This macro can be used to silence deprecation warnings and should be used as a last resort to silence the compiler for very specific lines of code. The typical pattern is:

// call to a function or class that has been deprecated.
#define NS_WARNING_POP
Pops the diagnostic warning list from the stack, restoring it to the previous state.
Definition: warnings.h:113
#define NS_WARNING_PUSH_DEPRECATED
Save the current warning list and disables the ones about deprecated functions and classes.
Definition: warnings.h:125

This macro is equivalent to

Its use is, of course, not suggested unless strictly necessary.

Definition at line 125 of file warnings.h.

◆ NS_WARNING_PUSH_MAYBE_UNINITIALIZED

#define NS_WARNING_PUSH_MAYBE_UNINITIALIZED
Value:
#define NS_WARNING_SILENCE_MAYBE_UNINITIALIZED
Silences GCC "-Wmaybe-uninitialized" warnings.
Definition: warnings.h:122

Save the current warning list and disables the ones about possible uninitialized variables.

This macro is equivalent to

See also
NS_WARNING_PUSH_DEPRECATED

Definition at line 129 of file warnings.h.

◆ NS_WARNING_SILENCE_DEPRECATED

#define NS_WARNING_SILENCE_DEPRECATED

Silences the "-Wdeprecated-declarations" warnings.

See also
NS_WARNING_POP

Definition at line 112 of file warnings.h.

◆ NS_WARNING_SILENCE_MAYBE_UNINITIALIZED

#define NS_WARNING_SILENCE_MAYBE_UNINITIALIZED

Silences GCC "-Wmaybe-uninitialized" warnings.

See also
NS_WARNING_POP

Definition at line 122 of file warnings.h.