A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
Compiler warnings
+ 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 102 of file warnings.h.

Referenced by LiIonEnergyTestCase::DoRun(), ns3::tests::TypeTraitsTestCase::DoRun(), ns3::Ipv4::GetTypeId(), and PrintCellInfo().

◆ 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 100 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:100
#define NS_WARNING_SILENCE_DEPRECATED
Silences the "-Wdeprecated-declarations" warnings.
Definition warnings.h:101

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:102
#define NS_WARNING_PUSH_DEPRECATED
Save the current warning list and disables the ones about deprecated functions and classes.
Definition warnings.h:114

This macro is equivalent to

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

Definition at line 114 of file warnings.h.

Referenced by LiIonEnergyTestCase::DoRun(), ns3::tests::TypeTraitsTestCase::DoRun(), and ns3::Ipv4::GetTypeId().

◆ 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:111

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 118 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 101 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 111 of file warnings.h.