2012-02-24 12:13:16

by Siarhei Siamashka

[permalink] [raw]
Subject: [PATCH] sbc: fix "always_inline function might not be inlinable" warning

"__attribute__((always_inline))" does not replace "inline" and they
still need to be used together. This fixes "always_inline function
might not be inlinable [-Wattributes]" warning in gcc 4.7
---
sbc/sbc_primitives.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sbc/sbc_primitives.h b/sbc/sbc_primitives.h
index 3fec8d5..17ad4f7 100644
--- a/sbc/sbc_primitives.h
+++ b/sbc/sbc_primitives.h
@@ -31,7 +31,7 @@
#define SBC_X_BUFFER_SIZE 328

#ifdef __GNUC__
-#define SBC_ALWAYS_INLINE __attribute__((always_inline))
+#define SBC_ALWAYS_INLINE inline __attribute__((always_inline))
#else
#define SBC_ALWAYS_INLINE inline
#endif
--
1.7.3.4



2012-02-24 16:49:01

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] sbc: fix "always_inline function might not be inlinable" warning

Hi Siarhei,

On Fri, Feb 24, 2012, Siarhei Siamashka wrote:
> "__attribute__((always_inline))" does not replace "inline" and they
> still need to be used together. This fixes "always_inline function
> might not be inlinable [-Wattributes]" warning in gcc 4.7
> ---
> sbc/sbc_primitives.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

Applied. Thanks.

Johan