You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/02/21 05:57:49 UTC

[nuttx-apps] branch master updated: system/libuv: check GCC version before set special flags

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ac809e68 system/libuv: check GCC version before set special flags
8ac809e68 is described below

commit 8ac809e680bf4ddcc90ba14650b92aec5f3c9e42
Author: chao an <an...@xiaomi.com>
AuthorDate: Tue Feb 21 09:43:08 2023 +0800

    system/libuv: check GCC version before set special flags
    
    Signed-off-by: chao an <an...@xiaomi.com>
---
 system/libuv/Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/system/libuv/Makefile b/system/libuv/Makefile
index 6221782c2..534908859 100644
--- a/system/libuv/Makefile
+++ b/system/libuv/Makefile
@@ -49,10 +49,14 @@ CFLAGS += -I$(LIBUV_UNPACK)/src
 CFLAGS += -I$(LIBUV_UNPACK)/src/unix
 CFLAGS += -I$(LIBUV_UNPACK)/test
 CFLAGS += -Wno-shadow
-CFLAGS += -Wno-dangling-pointer
 CFLAGS += -DDEF_THREADPOOL_SIZE=CONFIG_LIBUV_THREADPOOL_SIZE
 CFLAGS += -DDEF_THREADPOOL_STACKSIZE=CONFIG_LIBUV_THREAD_STACKSIZE
 
+GCCVER = $(shell $(CC) --version | grep gcc | sed -r 's/.* ([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
+ifeq ($(GCCVER),12.2.1)
+  CFLAGS += -Wno-dangling-pointer
+endif
+
 VPATH += $(LIBUV_UNPACK)/src
 VPATH += $(LIBUV_UNPACK)/src/unix
 VPATH += $(LIBUV_UNPACK)/test