sarmfsw: SMFSW Toolbox (for ARM & compatible with Arduino platform) 3.7
SMFSW collection of miscellaneous functions & macros (for ARM & compatible with Arduino platform)
Loading...
Searching...
No Matches
arm_attributes.h File Reference

ARM common compilers attributes. More...

This graph shows which files directly or indirectly include this file:

Macros

#define __WEAK   __attribute__((weak))
 Weak attribute.
 
#define __IRQ   __attribute__((interrupt_handler))
 Interrupt attribute.
 
#define ATTR__(...)   __attribute__((__VA_ARGS__))
 Macro to define one or multiple attribute(s) ... for a declaration.
 
#define ALIGN__(n)   __attribute__((align(n)))
 Align attribute padded to n.
 
#define COLD__   __attribute__((cold))
 Cold attribute.
 
#define DEPRECATED__   __attribute__((deprecated))
 Deprecated attribute.
 
#define HOT__   __attribute__((hot))
 Hot attribute.
 
#define INLINE__   __attribute__((always_inline))
 Always inline attribute.
 
#define NONNULL__   __attribute__((nonnull))
 Non null attribute (all pointers will be checked)
 
#define NONNULLX__(...)   __attribute__((nonnull(__VA_ARGS__)))
 Non null attribute for ... pointers indexes.
 
#define NORETURN__   __attribute__((__noreturn__))
 No return attribute.
 
#define PACK__   __attribute__((packed))
 Packed attribute.
 
#define PURE__   __attribute__((pure))
 Pure attribute.
 
#define SECTION__(s)   __attribute__((section(#s)))
 Section attribute to place declaration into section s.
 
#define USED__   __attribute__((used))
 Used attribute ensures declaration won't be removed by garbage collector.
 
#define NONNULL_INLINE__   ATTR__(nonnull, always_inline)
 Non null and Always inline attributes.
 
#define SSO(o)   scalar_storage_order(#o)
 Alias for Scalar Storage Order.
 
#define BIG_ENDIAN__   ATTR__(packed, SSO(big-endian))
 Force structure in Big-Endian (use wisely or not at all)
 
#define LITTLE_ENDIAN__   ATTR__(packed, SSO(little-endian))
 Force structure in Little-Endian (use wisely or not at all)
 
#define __NOOPT__
 No Optimizations attribute.
 
#define __TYPEOF   __typeof__
 typeof keyword alias (
 
#define __ASM   __asm__
 asm keyword alias (
 
#define __STATIC   static
 static alias when functions visibility may be required (__INLINE remaining static)
 
#define __INLINE   static inline
 inline attribute alias
 
#define __INLINE   __attribute__((always_inline)) static inline
 inline attribute alias
 
#define __STATIC_INLINE   __attribute__((always_inline)) static inline
 static inline attribute alias when __NOOPT__ defined
 

Detailed Description

ARM common compilers attributes.

Author
SMFSW

Set attributes following compiler

Warning
Cosmic compiler for STM32 attributes not implemented
MISRA C:2012 Deviations

Header scope deviation has been granted for following rules:
Rule-20.5 - Advisory: #undef (misra-c2012-20.5)
Rule-20.10 - Advisory: # and ## preprocessor operators (misra-c2012-20.10)

Header scope legitimate use derogation authorized for:
Rule-21.1 - Required: #define and #undef on reserved identifiers (misra-c2012-21.1)
Justification: #define are generic reserved identifiers for attributes.

Macro Definition Documentation

◆ __ASM

#define __ASM   __asm__

asm keyword alias (

Note
so that it may prior be set to other expansion following compiler)

◆ __INLINE [1/2]

#define __INLINE   static inline

inline attribute alias

inline attribute alias when __NOOPT__ defined

Note
Doesn't optimize code size much (when generated as functions) as code will be static to each file and hidden from others (leading to code duplicates)

◆ __INLINE [2/2]

#define __INLINE   __attribute__((always_inline)) static inline

inline attribute alias

inline attribute alias when __NOOPT__ defined

Note
Doesn't optimize code size much (when generated as functions) as code will be static to each file and hidden from others (leading to code duplicates)

◆ __IRQ

#define __IRQ   __attribute__((interrupt_handler))

Interrupt attribute.

◆ __NOOPT__

#define __NOOPT__

No Optimizations attribute.

◆ __STATIC

#define __STATIC   static

static alias when functions visibility may be required (__INLINE remaining static)

◆ __STATIC_INLINE

#define __STATIC_INLINE   __attribute__((always_inline)) static inline

static inline attribute alias when __NOOPT__ defined

◆ __TYPEOF

#define __TYPEOF   __typeof__

typeof keyword alias (

Note
so that it may prior be set to other expansion following compiler)

◆ __WEAK

#define __WEAK   __attribute__((weak))

Weak attribute.

◆ ALIGN__

#define ALIGN__ ( n)    __attribute__((align(n)))

Align attribute padded to n.

◆ ATTR__

#define ATTR__ ( ...)    __attribute__((__VA_ARGS__))

Macro to define one or multiple attribute(s) ... for a declaration.

◆ BIG_ENDIAN__

#define BIG_ENDIAN__   ATTR__(packed, SSO(big-endian))

Force structure in Big-Endian (use wisely or not at all)

◆ COLD__

#define COLD__   __attribute__((cold))

Cold attribute.

◆ DEPRECATED__

#define DEPRECATED__   __attribute__((deprecated))

Deprecated attribute.

◆ HOT__

#define HOT__   __attribute__((hot))

Hot attribute.

◆ INLINE__

#define INLINE__   __attribute__((always_inline))

Always inline attribute.

◆ LITTLE_ENDIAN__

#define LITTLE_ENDIAN__   ATTR__(packed, SSO(little-endian))

Force structure in Little-Endian (use wisely or not at all)

◆ NONNULL__

#define NONNULL__   __attribute__((nonnull))

Non null attribute (all pointers will be checked)

◆ NONNULL_INLINE__

#define NONNULL_INLINE__   ATTR__(nonnull, always_inline)

Non null and Always inline attributes.

◆ NONNULLX__

#define NONNULLX__ ( ...)    __attribute__((nonnull(__VA_ARGS__)))

Non null attribute for ... pointers indexes.

◆ NORETURN__

#define NORETURN__   __attribute__((__noreturn__))

No return attribute.

◆ PACK__

#define PACK__   __attribute__((packed))

Packed attribute.

◆ PURE__

#define PURE__   __attribute__((pure))

Pure attribute.

◆ SECTION__

#define SECTION__ ( s)    __attribute__((section(#s)))

Section attribute to place declaration into section s.

◆ SSO

#define SSO ( o)    scalar_storage_order(#o)

Alias for Scalar Storage Order.

◆ USED__

#define USED__   __attribute__((used))

Used attribute ensures declaration won't be removed by garbage collector.