ARM-software / CMSIS-DSP

CMSIS-DSP embedded compute library for Cortex-M and Cortex-A
https://arm-software.github.io/CMSIS-DSP
Apache License 2.0
459 stars 123 forks source link

Static Function used in Inline Function Warning #131

Closed XenuIsWatching closed 7 months ago

XenuIsWatching commented 7 months ago

A warning is generated where "'vlogq_f32' is static but used in inline function 'vlogq_f16' which is not static". I'd submit a PR myself... but I suspect this issue exists within many other functions. This was only found as the Zephyr CI swept through only the parts that it compiled for its test cases. I'm also back on paternity leave 👶 and really out of time now to investigate this myself.

A workaround I did just to get it merged with Zephyr was done with this commit https://github.com/zephyrproject-rtos/cmsis-dsp/commit/ff7b5fd1ea5f094665c090c343ec44e74dc0b193 I rather this fixed upstream so that commit isn't cherry-pick'ed with every release

The error message while compiling

[161/746] Building C object modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/Source/BasicMathFunctions/arm_xor_u8.c.obj
[162/746] Building C object modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/Source/CommonTables/arm_common_tables_f16.c.obj
[163/746] Building C object modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/Source/CommonTables/arm_const_structs.c.obj
[164/746] Building C object modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/Source/ComplexMathFunctions/arm_cmplx_mag_q31.c.obj
[165/746] Building C object modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/Source/CommonTables/arm_const_structs_f16.c.obj
[166/746] Building C object modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/Source/ComplexMathFunctions/arm_cmplx_mag_fast_q15.c.obj
[167/746] Building C object modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Source/arm_cl_tables.c.obj
FAILED: modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Source/arm_cl_tables.c.obj
ccache /opt/toolchains/zephyr-sdk-0.16.1/aarch64-zephyr-elf/bin/aarch64-zephyr-elf-gcc -DARM_MATH_NEON -DDISABLEFLOAT16 -DKERNEL -DTC_RUNID=5051548ea54115f165763b28ffd842cc -D_ANSI_SOURCE -D_FORTIFY_SOURCE=2 -D__GNUC_PYTHON__ -D__LINUX_ERRNO_EXTENSIONS__ -D__ZEPHYR__=1 -I/__w/zephyr/modules/lib/cmsis-dsp/PrivateInclude -I/__w/zephyr/modules/hal/cmsis/CMSIS/Core/Include -I/__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Include -I/__w/zephyr/modules/lib/cmsis-dsp/Source/DistanceFunctions -I/__w/zephyr/zephyr/include -I/__w/zephyr/zephyr/twister-out/intel_socfpga_agilex5_socdk/tests/subsys/dsp/basicmath/zdsp.basicmath.fpu/zephyr/include/generated -I/__w/zephyr/zephyr/soc/arm64/intel_socfpga/agilex5 -I/__w/zephyr/zephyr/lib/libc/newlib/include -I/__w/zephyr/zephyr/soc/arm64/intel_socfpga/agilex5/. -I/__w/zephyr/zephyr/soc/arm64/intel_socfpga/common/. -I/__w/zephyr/zephyr/soc/arm64/intel_socfpga/common -I/__w/zephyr/zephyr/subsys/testsuite/include -I/__w/zephyr/zephyr/subsys/testsuite/ztest/include -I/__w/zephyr/zephyr/subsys/dsp/cmsis/public -I/__w/zephyr/modules/lib/acpica/../../zephyr/include -I/__w/zephyr/modules/lib/acpica/.. -I/__w/zephyr/modules/lib/acpica/source/include -I/__w/zephyr/modules/lib/acpica/source/include/platform -I/__w/zephyr/modules/lib/acpica/source/compiler -I/__w/zephyr/modules/lib/acpica/generate/zephyr -I/__w/zephyr/modules/lib/acpica/source/tools/acpiexec -I/__w/zephyr/modules/lib/acpica/source/tools/acpidump -I/__w/zephyr/modules/lib/cmsis-dsp/Include -fno-strict-aliasing -Werror -Os -imacros /__w/zephyr/zephyr/twister-out/intel_socfpga_agilex5_socdk/tests/subsys/dsp/basicmath/zdsp.basicmath.fpu/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-a76 -mtune=cortex-a76.cortex-a55 -mabi=lp64 --sysroot=/opt/toolchains/zephyr-sdk-0.16.1/aarch64-zephyr-elf/aarch64-zephyr-elf -imacros /__w/zephyr/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/__w/zephyr/zephyr/tests/subsys/dsp/basicmath=CMAKE_SOURCE_DIR -fmacro-prefix-map=/__w/zephyr/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/__w/zephyr=WEST_TOPDIR -ffunction-sections -fdata-sections -moverride=tune=no_ldp_stp_qregs -std=c99 -Ofast -MD -MT modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Source/arm_cl_tables.c.obj -MF modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Source/arm_cl_tables.c.obj.d -o modules/cmsis-dsp/CMakeFiles/modules__cmsis_dsp.dir/__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Source/arm_cl_tables.c.obj -c /__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Source/arm_cl_tables.c
In file included from /__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Source/arm_cl_tables.c:25:
/__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Include/NEMath.h:451:79: error: 'vlogq_f32' is static but used in inline function 'vlogq_f16' which is not static [-Werror]
 451 | const float16x8_t res = vcvt_high_f16_f32(vcvt_f16_f32(vlogq_f32(x_low)), vlogq_f32(x_high));
 | ^~~~~~~~~
/__w/zephyr/modules/lib/cmsis-dsp/ComputeLibrary/Include/NEMath.h:451:60: error: 'vlogq_f32' is static but used in inline function 'vlogq_f16' which is not static [-Werror]
 451 | const float16x8_t res = vcvt_high_f16_f32(vcvt_f16_f32(vlogq_f32(x_low)), vlogq_f32(x_high));
 | ^~~~~~~~~
cc1: all warnings being treated as error
christophe0606 commented 7 months ago

@XenuIsWatching It should be corrected in latest commit.