nRF5 SDK for Thread and Zigbee v4.2.0
Macros

This module defines a toolchain abstraction layer through macros. More...

Macros

#define OT_MUST_USE_RESULT
 
#define OT_TOOL_PACKED_BEGIN
 
#define OT_TOOL_PACKED_FIELD
 
#define OT_TOOL_WEAK
 
#define OT_UNUSED_VARIABLE(VARIABLE)
 
#define OT_UNREACHABLE_CODE(CODE)   CODE
 
#define OT_APPLE_IGNORE_GNU_FOLDING_CONSTANT(...)   __VA_ARGS__
 

Detailed Description

This module defines a toolchain abstraction layer through macros.

Usage:

typedef
struct
{
char mField1;
union
{
char mField2;
long mField3;
} OT_TOOL_PACKED_END packed_struct_t;

Macro Definition Documentation

#define OT_MUST_USE_RESULT

Compiler-specific indication that a class or enum must be used when it is the return value of a function.

Note
This is currently only available with clang (C++17 implements it as attribute [[nodiscard]]).
To suppress the 'unused-result' warning/error, please use the '-Wno-unused-result' compiler option.
#define OT_TOOL_PACKED_BEGIN

Compiler-specific indication that a class or struct must be byte packed.

#define OT_TOOL_PACKED_FIELD

Indicate to the compiler a nested struct or union to be packed within byte packed class or struct.

#define OT_TOOL_WEAK

Compiler-specific weak symbol modifier.

#define OT_UNREACHABLE_CODE (   CODE)    CODE

Suppress Unreachable code warning in specific toolchains.

#define OT_UNUSED_VARIABLE (   VARIABLE)
Value:
do \
{ \
(void)(VARIABLE); \
} while (false)

Suppress unused variable warning in specific toolchains.


Documentation feedback | Developer Zone | Subscribe | Updated