From fd136da04ade528edb666bf00a7bc7c4bd4d120c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Mon, 15 Oct 2012 00:53:37 +0200 Subject: [PATCH] unix: remove always_inline attribute Fixes the following gcc 4.7+ warning: ../src/unix/internal.h:105:13: warning: always_inline function might not be inlinable [-Wattributes] gcc wants the always_inline function to be annotated with the 'inline' keyword which we can't do because we compile in C89 mode. Using __inline is not an option because that makes clang generate warnings when -Wlanguage-extension-token is enabled. Therefore, remove the always_inline attribute altogether and hope that the compiler is smart enough to inline the functions. --- src/unix/async.c | 1 - src/unix/internal.h | 1 - 2 files changed, 2 deletions(-) diff --git a/src/unix/async.c b/src/unix/async.c index 63bedf56..4d3cd94f 100644 --- a/src/unix/async.c +++ b/src/unix/async.c @@ -30,7 +30,6 @@ static int uv__async_init(uv_loop_t* loop); static void uv__async_io(uv_loop_t* loop, uv__io_t* handle, int events); -__attribute__((always_inline)) static int uv__async_make_pending(volatile sig_atomic_t* ptr) { /* Do a cheap read first. */ if (*ptr) diff --git a/src/unix/internal.h b/src/unix/internal.h index 5685e1a8..23266764 100644 --- a/src/unix/internal.h +++ b/src/unix/internal.h @@ -101,7 +101,6 @@ enum { }; __attribute__((unused)) -__attribute__((always_inline)) static void uv__req_init(uv_loop_t* loop, uv_req_t* req, uv_req_type type) { req->type = type; uv__req_register(loop, req);