warning: always_inline function might not be inlinable [-Wattributes]

后端 未结 3 590
说谎
说谎 2021-01-04 03:04

when i try to include a .h file which consists of definition for inline functions as

__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __SLA (int3         


        
3条回答
  •  天涯浪人
    2021-01-04 03:25

    What that warning is saying is that the compiler, is not always happy accepting your function as inline, or it wants it to be declared as inline.

    I guess it's that __attribute__ ((always_inline)) implies inline - in which case the parsing of the attribute needs to set DECL_DECLARED_INLINE_P.

    The GCC manual specifies

    always_inline Generally, functions are not inlined unless optimization is specified. For functions declared inline, this attribute inlines the function even if no optimization level is specified.

    Here's the gcc test for the revision

提交回复
热议问题