Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
toolchain.h File Reference

Macros to abstract toolchain specific capabilities. More...

Go to the source code of this file.

Macros

#define HAS_BUILTIN(x)
 Check if the compiler supports the built-in function x.
 
#define TOOLCHAIN_GCC_VERSION   0
 GCC version in xxyyzz for xx.yy.zz.
 
#define TOOLCHAIN_CLANG_VERSION   0
 Clang version in xxyyzz for xx.yy.zz.
 
#define TOOLCHAIN_HAS_PRAGMA_DIAG   0
 Indicate if toolchain supports #pragma diagnostics.
 
#define TOOLCHAIN_HAS_C_GENERIC   0
 Indicate if toolchain supports C Generic.
 
#define TOOLCHAIN_HAS_C_AUTO_TYPE   0
 Indicate if toolchain supports C __auto_type.
 
#define TOOLCHAIN_HAS_ZLA   0
 Indicate if toolchain supports Zero Length Arrays.
 
#define TOOLCHAIN_PRAGMA(x)
 Helper for using pragma in macros.
 
#define TOOLCHAIN_WARNING_ADDRESS_OF_PACKED_MEMBER
 Toolchain-specific warning for taking the address of a packed member.
 
#define TOOLCHAIN_WARNING_ARRAY_BOUNDS
 Toolchain-specific warning for array bounds violations.
 
#define TOOLCHAIN_WARNING_ATTRIBUTES
 Toolchain-specific warning for unknown attributes.
 
#define TOOLCHAIN_WARNING_DELETE_NON_VIRTUAL_DTOR
 Toolchain-specific warning for deleting a pointer to an object with a non-virtual destructor.
 
#define TOOLCHAIN_WARNING_EXTRA
 Toolchain-specific warning for extra warnings.
 
#define TOOLCHAIN_WARNING_NONNULL
 Toolchain-specific warning for null pointer arguments to functions marked with "nonnull".
 
#define TOOLCHAIN_WARNING_POINTER_ARITH
 Toolchain-specific warning for pointer arithmetic.
 
#define TOOLCHAIN_WARNING_SHADOW
 Toolchain-specific warning for shadow variables.
 
#define TOOLCHAIN_WARNING_UNUSED_LABEL
 Toolchain-specific warning for unused labels.
 
#define TOOLCHAIN_WARNING_UNUSED_VARIABLE
 Toolchain-specific warning for unused variables.
 
#define TOOLCHAIN_DISABLE_WARNING(warning)
 Disable the specified compiler warning for all compilers.
 
#define TOOLCHAIN_ENABLE_WARNING(warning)
 Re-enable the specified compiler warning for all compilers.
 
#define TOOLCHAIN_DISABLE_CLANG_WARNING(warning)
 Disable the specified compiler warning for clang.
 
#define TOOLCHAIN_ENABLE_CLANG_WARNING(warning)
 Re-enable the specified compiler warning for clang.
 
#define TOOLCHAIN_DISABLE_GCC_WARNING(warning)
 Disable the specified compiler warning for gcc.
 
#define TOOLCHAIN_ENABLE_GCC_WARNING(warning)
 Re-enable the specified compiler warning for gcc.
 
#define TOOLCHAIN_DISABLE_IAR_WARNING(warning)
 Disable the specified compiler warning for IAR compilers.
 
#define TOOLCHAIN_ENABLE_IAR_WARNING(warning)
 Re-enable the specified compiler warning for IAR compilers.
 

Detailed Description

Macros to abstract toolchain specific capabilities.

This file contains various macros to abstract compiler capabilities that utilize toolchain specific attributes and/or pragmas.

Macro Definition Documentation

◆ HAS_BUILTIN

#define HAS_BUILTIN ( x)
Value:
HAS_BUILTIN_##x

Check if the compiler supports the built-in function x.

This macro is for use with conditional compilation to enable code using a builtin function that may not be available in every compiler.

◆ TOOLCHAIN_CLANG_VERSION

#define TOOLCHAIN_CLANG_VERSION   0

Clang version in xxyyzz for xx.yy.zz.

Zero if not Clang compatible.

◆ TOOLCHAIN_DISABLE_CLANG_WARNING

#define TOOLCHAIN_DISABLE_CLANG_WARNING ( warning)

Disable the specified compiler warning for clang.

◆ TOOLCHAIN_DISABLE_GCC_WARNING

#define TOOLCHAIN_DISABLE_GCC_WARNING ( warning)

Disable the specified compiler warning for gcc.

◆ TOOLCHAIN_DISABLE_IAR_WARNING

#define TOOLCHAIN_DISABLE_IAR_WARNING ( warning)

Disable the specified compiler warning for IAR compilers.

◆ TOOLCHAIN_DISABLE_WARNING

#define TOOLCHAIN_DISABLE_WARNING ( warning)

Disable the specified compiler warning for all compilers.

◆ TOOLCHAIN_ENABLE_CLANG_WARNING

#define TOOLCHAIN_ENABLE_CLANG_WARNING ( warning)

Re-enable the specified compiler warning for clang.

Can only be used after a call to TOOLCHAIN_DISABLE_CLANG_WARNING.

◆ TOOLCHAIN_ENABLE_GCC_WARNING

#define TOOLCHAIN_ENABLE_GCC_WARNING ( warning)

Re-enable the specified compiler warning for gcc.

Can only be used after a call to TOOLCHAIN_DISABLE_GCC_WARNING.

◆ TOOLCHAIN_ENABLE_IAR_WARNING

#define TOOLCHAIN_ENABLE_IAR_WARNING ( warning)

Re-enable the specified compiler warning for IAR compilers.

Can only be used after a call to TOOLCHAIN_DISABLE_IAR_WARNING.

◆ TOOLCHAIN_ENABLE_WARNING

#define TOOLCHAIN_ENABLE_WARNING ( warning)

Re-enable the specified compiler warning for all compilers.

Can only be used after a call to TOOLCHAIN_DISABLE_WARNING.

◆ TOOLCHAIN_GCC_VERSION

#define TOOLCHAIN_GCC_VERSION   0

GCC version in xxyyzz for xx.yy.zz.

Zero if not GCC compatible.

◆ TOOLCHAIN_HAS_C_AUTO_TYPE

#define TOOLCHAIN_HAS_C_AUTO_TYPE   0

Indicate if toolchain supports C __auto_type.

◆ TOOLCHAIN_HAS_C_GENERIC

#define TOOLCHAIN_HAS_C_GENERIC   0

Indicate if toolchain supports C Generic.

◆ TOOLCHAIN_HAS_PRAGMA_DIAG

#define TOOLCHAIN_HAS_PRAGMA_DIAG   0

Indicate if toolchain supports #pragma diagnostics.

◆ TOOLCHAIN_HAS_ZLA

#define TOOLCHAIN_HAS_ZLA   0

Indicate if toolchain supports Zero Length Arrays.

◆ TOOLCHAIN_PRAGMA

#define TOOLCHAIN_PRAGMA ( x)
Value:
_Pragma(#x)

Helper for using pragma in macros.

◆ TOOLCHAIN_WARNING_ADDRESS_OF_PACKED_MEMBER

#define TOOLCHAIN_WARNING_ADDRESS_OF_PACKED_MEMBER

Toolchain-specific warning for taking the address of a packed member.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_ARRAY_BOUNDS

#define TOOLCHAIN_WARNING_ARRAY_BOUNDS

Toolchain-specific warning for array bounds violations.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_ATTRIBUTES

#define TOOLCHAIN_WARNING_ATTRIBUTES

Toolchain-specific warning for unknown attributes.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_DELETE_NON_VIRTUAL_DTOR

#define TOOLCHAIN_WARNING_DELETE_NON_VIRTUAL_DTOR

Toolchain-specific warning for deleting a pointer to an object with a non-virtual destructor.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_EXTRA

#define TOOLCHAIN_WARNING_EXTRA

Toolchain-specific warning for extra warnings.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_NONNULL

#define TOOLCHAIN_WARNING_NONNULL

Toolchain-specific warning for null pointer arguments to functions marked with "nonnull".

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_POINTER_ARITH

#define TOOLCHAIN_WARNING_POINTER_ARITH

Toolchain-specific warning for pointer arithmetic.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_SHADOW

#define TOOLCHAIN_WARNING_SHADOW

Toolchain-specific warning for shadow variables.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_UNUSED_LABEL

#define TOOLCHAIN_WARNING_UNUSED_LABEL

Toolchain-specific warning for unused labels.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.

◆ TOOLCHAIN_WARNING_UNUSED_VARIABLE

#define TOOLCHAIN_WARNING_UNUSED_VARIABLE

Toolchain-specific warning for unused variables.

Use this as an argument to the TOOLCHAIN_DISABLE_WARNING and TOOLCHAIN_ENABLE_WARNING family of macros.