Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Jun 2024 17:42:38 GMT
From:      Ryan Libby <rlibby@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: d25f0bdceb3a - main - cdefs.h: add __inline to __always_inline
Message-ID:  <202406251742.45PHgcSs040210@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by rlibby:

URL: https://cgit.FreeBSD.org/src/commit/?id=d25f0bdceb3abb798342821791d7ececb4ba3411

commit d25f0bdceb3abb798342821791d7ececb4ba3411
Author:     Ryan Libby <rlibby@FreeBSD.org>
AuthorDate: 2024-06-25 17:39:13 +0000
Commit:     Ryan Libby <rlibby@FreeBSD.org>
CommitDate: 2024-06-25 17:39:13 +0000

    cdefs.h: add __inline to __always_inline
    
    Add __inline to the __always_inline macro to quiet dozens of gcc
    warnings of the form:
    warning: 'always_inline' function might not be inlinable [-Wattributes]
    
    It's clearly the intention of the __always_inline macro applied to a
    function to inline the function.  However, gcc seems to be picky with
    the -Wattributes.  It appears that __attribute__((__always_inline__))
    was intended to apply to inline functions, as in, function declarations
    with the attribute should also be declared as inline.  Both clang and
    gcc sources themselves use the two in combination:
    inline __attribute__((__always_inline__))
    
    FreeBSD sources mostly only use __always_inline, without the inline
    keyword.  Only a few files in libmsun used both.
    
    Reviewed by:    imp, kib, olce
    Sponsored by:   Dell EMC Isilon
    Differential Revision:  https://reviews.freebsd.org/D45711
---
 sys/sys/cdefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/sys/cdefs.h b/sys/sys/cdefs.h
index 58146ddc721c..53ac1b1c3f92 100644
--- a/sys/sys/cdefs.h
+++ b/sys/sys/cdefs.h
@@ -265,7 +265,7 @@
 #define	__malloc_like	__attribute__((__malloc__))
 #define	__pure		__attribute__((__pure__))
 
-#define	__always_inline	__attribute__((__always_inline__))
+#define	__always_inline	__inline __attribute__((__always_inline__))
 #define	__noinline	__attribute__ ((__noinline__))
 #define	__fastcall	__attribute__((__fastcall__))
 #define	__result_use_check	__attribute__((__warn_unused_result__))



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406251742.45PHgcSs040210>