git: <sys/cdefs.h>: Add '__inline' to '__always_inline'

Aaron LI aly at crater.dragonflybsd.org
Wed Aug 27 01:09:20 PDT 2025


commit 1785ca1a2d0fc45766ca6e73d51b0096fb34ac43
Author: Aaron LI <aly at aaronly.me>
Date:   Wed Aug 27 07:11:09 2025 +0800

    <sys/cdefs.h>: Add '__inline' to '__always_inline'
    
    It's clearly the intention of the '__always_inline' macro applied to a
    function to inline the function.  However, GCC seems to only allow the
    '__attribute__((__always_inline__))' to be applied to inline functions;
    in other words, function declarations with the attribute should also be
    declared as inline.
    
    Both GCC/Clang sources themselves use the two in combination:
    	inline __attribute__((__always_inline__))
    
    At this moment, DragonFly kernel souces (except the DRM sources ported
    from Linux) also use the two in combination, i.e., the same as GCC/Clang
    above.  So the main intention of this change is to help future code
    ported from FreeBSD and other systems.
    
    This change could helps eliminate the GCC warnings of this form:
    warning: 'always_inline' function might not be inlinable [-Wattributes]
    
    Obtain-from: FreeBSD
    - Commit: d25f0bdceb3abb798342821791d7ececb4ba3411
    - Differential Revision: https://reviews.freebsd.org/D45711
    
    Discussed-with: swildner

Summary of changes:
 sys/sys/cdefs.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1785ca1a2d0fc45766ca6e73d51b0096fb34ac43


-- 
DragonFly BSD source repository


More information about the Commits mailing list