diff mbox series

[uclibc-ng-devel] Clang support for gnu_inline attribute

Message ID 20240705161858.15938-3-marcus.haehnel@kernkonzept.com
State Superseded
Headers show
Series [uclibc-ng-devel] Clang support for gnu_inline attribute | expand

Commit Message

Marcus Haehnel July 5, 2024, 4:18 p.m. UTC
From: Marcus Hähnel <marcus.haehnel@kernkonzept.com>

Clang also supports the gnu_inline attribute and the
__GNUC_STDC_INLINE__ macro (C99 semantics). However, it reports as
GCC 4.2 compatible (__GNUC_MINOR__ / __GNUC__) and thus the current
defines do not think it can support this.

Add clang as an alternative for this support. Documentation shows that
this attribute is supported since at least Clang 8.
---
Requires the features.h change that introduces the __CLANG_PREREQ macro

 include/sys/cdefs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Waldemar Brodkorb July 6, 2024, 9:24 a.m. UTC | #1
Hi Marcus,
Marcus Haehnel wrote,

Can you check this patch, it does not apply.
Is it possible that your comment missing a --- end?

best regards
 Waldemar

> From: Marcus Hähnel <marcus.haehnel@kernkonzept.com>
> 
> Clang also supports the gnu_inline attribute and the
> __GNUC_STDC_INLINE__ macro (C99 semantics). However, it reports as
> GCC 4.2 compatible (__GNUC_MINOR__ / __GNUC__) and thus the current
> defines do not think it can support this.
> 
> Add clang as an alternative for this support. Documentation shows that
> this attribute is supported since at least Clang 8.
> ---
> Requires the features.h change that introduces the __CLANG_PREREQ macro
> 
>  include/sys/cdefs.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
> index 9b3a02177..656548c52 100644
> --- a/include/sys/cdefs.h
> +++ b/include/sys/cdefs.h
> @@ -320,7 +320,7 @@
>     inline semantics, unless -fgnu89-inline is used.
>     For -std=gnu99, forcing gnu_inline attribute does not change behavior,
>     but may silence spurious warnings (such as in GCC 4.2).  */
> -#if !defined __cplusplus || __GNUC_PREREQ (4,3)
> +#if !defined __cplusplus || __GNUC_PREREQ (4,3) || __CLANG_PREREQ(8,0)
>  # if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ || defined __cplusplus
>  #  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
>  #  if __GNUC_PREREQ (4,3)
> -- 
> 2.43.0
> 
> _______________________________________________
> devel mailing list -- devel@uclibc-ng.org
> To unsubscribe send an email to devel-leave@uclibc-ng.org
Marcus Haehnel July 6, 2024, 11:53 a.m. UTC | #2
Hi Waldemar,

Strange, the comment looked right to me. But I have to say I'm not an expert in git send-mail formats.

I tried again, this time without the comment. I hope it helps.

Best regards,

- Marcus
On Sat, 2024-07-06 at 11:24 +0200, Waldemar Brodkorb wrote:
> Hi Marcus,
> Marcus Haehnel wrote,
> 
> Can you check this patch, it does not apply.
> Is it possible that your comment missing a --- end?
> 
> best regards
>  Waldemar
> 
> > From: Marcus Hähnel <marcus.haehnel@kernkonzept.com>
> > 
> > Clang also supports the gnu_inline attribute and the
> > __GNUC_STDC_INLINE__ macro (C99 semantics). However, it reports as
> > GCC 4.2 compatible (__GNUC_MINOR__ / __GNUC__) and thus the current
> > defines do not think it can support this.
> > 
> > Add clang as an alternative for this support. Documentation shows that
> > this attribute is supported since at least Clang 8.
> > ---
> > Requires the features.h change that introduces the __CLANG_PREREQ macro
> > 
> >  include/sys/cdefs.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
> > index 9b3a02177..656548c52 100644
> > --- a/include/sys/cdefs.h
> > +++ b/include/sys/cdefs.h
> > @@ -320,7 +320,7 @@
> >     inline semantics, unless -fgnu89-inline is used.
> >     For -std=gnu99, forcing gnu_inline attribute does not change behavior,
> >     but may silence spurious warnings (such as in GCC 4.2).  */
> > -#if !defined __cplusplus || __GNUC_PREREQ (4,3)
> > +#if !defined __cplusplus || __GNUC_PREREQ (4,3) || __CLANG_PREREQ(8,0)
> >  # if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ || defined __cplusplus
> >  #  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
> >  #  if __GNUC_PREREQ (4,3)
> > -- 
> > 2.43.0
> > 
> > _______________________________________________
> > devel mailing list -- devel@uclibc-ng.org
> > To unsubscribe send an email to devel-leave@uclibc-ng.org
> _______________________________________________
> devel mailing list -- devel@uclibc-ng.org
> To unsubscribe send an email to devel-leave@uclibc-ng.org
diff mbox series

Patch

diff --git a/include/sys/cdefs.h b/include/sys/cdefs.h
index 9b3a02177..656548c52 100644
--- a/include/sys/cdefs.h
+++ b/include/sys/cdefs.h
@@ -320,7 +320,7 @@ 
    inline semantics, unless -fgnu89-inline is used.
    For -std=gnu99, forcing gnu_inline attribute does not change behavior,
    but may silence spurious warnings (such as in GCC 4.2).  */
-#if !defined __cplusplus || __GNUC_PREREQ (4,3)
+#if !defined __cplusplus || __GNUC_PREREQ (4,3) || __CLANG_PREREQ(8,0)
 # if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__ || defined __cplusplus
 #  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
 #  if __GNUC_PREREQ (4,3)