From 507056e8706124e2a5cf24589ce70d8cfbba79bb Mon Sep 17 00:00:00 2001 From: fangxinyong Date: Mon, 31 Mar 2025 21:53:19 +0800 Subject: [PATCH] cmake(bugfix):fix arch x86_64 cmake build openlibm warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building C object libs/libm/openlibm/CMakeFiles/m.dir/openlibm/src/s_clog.c.obj In file included from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/math_private.h:22, from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:61: /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:78:33: warning: ‘clogl’ alias between functions of incompatible types ‘_Complex long double(_Complex long double)’ and ‘_Complex double(_Complex double)’ [-Wattribute-alias=] 78 | openlibm_strong_reference(clog, clogl); | ^~~~~ /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/cdefs-compat.h:24:50: note: in definition of macro ‘openlibm_strong_reference’ 24 | OLM_DLLEXPORT extern __typeof (aliassym) aliassym __attribute__ ((__alias__ (#sym))); | ^~~~~~~~ /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/src/s_clog.c:64:1: note: aliased declaration here 64 | clog(double complex z) Building C object libs/libm/openlibm/CMakeFiles/m.dir/openlibm/amd64/fenv.c.obj In file included from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv.h:8, from /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/amd64/fenv.c:35: /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv_amd64.h:99:1: warning: declaration of ‘feclearexcept’ shadows a built-in function [-Wshadow] 99 | feclearexcept(int __excepts) | ^~~~~~~~~~~~~ /work/rel-5.0/nuttx/libs/libm/openlibm/openlibm/include/openlibm_fenv_amd64.h:117:1: warning: declaration of ‘fegetexceptflag’ shadows a built-in function [-Wshadow] 117 | fegetexceptflag(fexcept_t *__flagp, int __excepts) Signed-off-by: fangxinyong --- libs/libm/openlibm/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/libm/openlibm/CMakeLists.txt b/libs/libm/openlibm/CMakeLists.txt index d5e34b35e40..e778b27614b 100644 --- a/libs/libm/openlibm/CMakeLists.txt +++ b/libs/libm/openlibm/CMakeLists.txt @@ -228,6 +228,8 @@ if(CONFIG_LIBM_OPENLIBM) file(GLOB_RECURSE ARCH_ASRCS ${OPENLIBM_DIR}/${ARCH}/*.S) file(GLOB_RECURSE BD_CSRCS ${OPENLIBM_DIR}/bsdsrc/*.c) + add_compile_options(-Wno-attribute-alias -Wno-shadow) + # ############################################################################ # Include Directory # ############################################################################