[PATCH] [CORE] Avoid the "always_inline function might not be inlinable" warning.

203 views
Skip to first unread message

Jimmy Durand Wesolowski

unread,
Nov 19, 2014, 8:43:12 AM11/19/14
to xvisor...@googlegroups.com, Jimmy Durand Wesolowski
GCC displays a warning about the fact a function may not be inlined even if
told so, if no optimization is asked for. To avoid this, as explained in the
GCC manual :
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.

Adding "inline" correct this warning.

Signed-off-by: Jimmy Durand Wesolowski <jimmy.duran...@openwide.fr>
---
core/include/vmm_compiler.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/include/vmm_compiler.h b/core/include/vmm_compiler.h
index 4ddbf05..b94f269 100644
--- a/core/include/vmm_compiler.h
+++ b/core/include/vmm_compiler.h
@@ -29,7 +29,7 @@
#define barrier() __asm__ __volatile__("": : :"memory")

#define __noinline __attribute__ ((noinline))
-#define __always_inline __attribute__((always_inline))
+#define __always_inline inline __attribute__((always_inline))
#define __unused __attribute__((unused))
#define __used __attribute__((used))
#define __aligned(x) __attribute__((aligned(x)))
--
1.8.3.2

Anup Patel

unread,
Nov 20, 2014, 11:41:52 PM11/20/14
to Xvisor Devel, Jimmy Durand Wesolowski
Applied your patch on xvisor-next tree.

Thanks,
Anup
Reply all
Reply to author
Forward
0 new messages