From 0221c436485da163d167094e52bfab7c282d1a16 Mon Sep 17 00:00:00 2001 From: dubaowei Date: Fri, 26 Nov 2021 15:45:52 +0800 Subject: [PATCH] [demo][linux] fix compile warning about old-style-declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In gcc 7.3.0, we encountered a warning error when compiling elog_file_port.c:76:1: warning: ‘inline’ is not at beginning of declaration [-Wold-style-declaration] Put 'inline' in front of 'void' can fix it Signed-off-by: dubaowei --- demo/os/linux/easylogger/port/elog_file_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/os/linux/easylogger/port/elog_file_port.c b/demo/os/linux/easylogger/port/elog_file_port.c index f700517..b34fc40 100755 --- a/demo/os/linux/easylogger/port/elog_file_port.c +++ b/demo/os/linux/easylogger/port/elog_file_port.c @@ -73,7 +73,7 @@ ElogErrCode elog_file_port_init(void) { /** * file log lock */ -void inline elog_file_port_lock(void) +inline void elog_file_port_lock(void) { semid == -1 ? -1 : semop(semid, (struct sembuf *)&down, 1); } @@ -81,7 +81,7 @@ void inline elog_file_port_lock(void) /** * file log unlock */ -void inline elog_file_port_unlock(void) +inline void elog_file_port_unlock(void) { semid == -1 ? -1 : semop(semid, (struct sembuf *)&up, 1); }