ARM-software / CMSIS_5

CMSIS Version 5 Development Repository
http://arm-software.github.io/CMSIS_5/index.html
Apache License 2.0
1.33k stars 1.08k forks source link

Incorrect DSP inline macro definitions in arm_math_types.h #1111

Closed stephanosio closed 3 years ago

stephanosio commented 3 years ago

As far as I can see, __attribute__((inline)) is not a valid attribute for GCC.

https://github.com/ARM-software/CMSIS_5/blob/a614de942bcee6df533ea1231898872fe06217f5/CMSIS/DSP/Include/arm_math_types.h#L67-L73

This should be fixed as follows:

#define __STATIC_FORCEINLINE static inline __attribute__((always_inline)) 
#define __STATIC_INLINE static inline

In addition, #pragma GCC diagnostic ignored "-Wattributes" should be removed as well, unless it is needed by something else.

christophe0606 commented 3 years ago

@stephanosio I'll correct it. But the code you quoted is only used when compiling the Python wrapper on host. So, you should not see the problem if the CMSIS compiler headers are used since they use a correct gcc definition.

Unless of course if your are compiling the Python wrapper ...

stephanosio commented 3 years ago

But the code you quoted is only used when compiling the Python wrapper on host. So, you should not see the problem if the CMSIS compiler headers are used since they use a correct gcc definition.

That is correct. We've encountered this issue in a Zephyr PR which attempts to build CMSIS-DSP for the Zephyr native POSIX arch (i.e. host) using __GNUC_PYTHON__.

christophe0606 commented 3 years ago

Should be correct in https://github.com/ARM-software/CMSIS_5/commit/71627bc91534ed9eec2361c0ef6442cd057653e0

stephanosio commented 3 years ago

Thanks for looking into this. Closing as the issue has been resolved.