Describe the bug
The macro names ROUND_UP() and ROUND_DOWN() are both defined in include/sys/util.h and in the CMSIS DSP library.
In the CMSIS DSP library they are protected by #ifndef/#endif, while they are not protected in include/sys/util.h.
To Reproduce
If the CMSIS DSP library is enabled one get compilation warnings/errors if arm_math.h is included before zephyr/kernel.h. If you sort inclusion files in alphabetical order this will happen.
Expected behavior
No compilation problems when using the CMSIS DSP library.
Impact
Changing the order of inclusion fixed the compilation error. But I wonder if this gives other problems?
Environment (please complete the following information):
OS: Linux
Toolchain Zephyr SDK 0.16.3
Discovered while porting a Zephyr 3.4.0 application to use 3.5.0
Additional context
I have a pull request for adding #ifndef/#endif to include/sys/util.h. But maybe that is the wrong solution and the best solution is to rename the macro names to avoid this problem?
Describe the bug The macro names
ROUND_UP()
andROUND_DOWN()
are both defined ininclude/sys/util.h
and in the CMSIS DSP library. In the CMSIS DSP library they are protected by#ifndef
/#endif
, while they are not protected ininclude/sys/util.h
.To Reproduce If the CMSIS DSP library is enabled one get compilation warnings/errors if
arm_math.h
is included beforezephyr/kernel.h
. If you sort inclusion files in alphabetical order this will happen.Expected behavior No compilation problems when using the CMSIS DSP library.
Impact Changing the order of inclusion fixed the compilation error. But I wonder if this gives other problems?
Environment (please complete the following information):
Additional context I have a pull request for adding
#ifndef
/#endif
toinclude/sys/util.h
. But maybe that is the wrong solution and the best solution is to rename the macro names to avoid this problem?The pull request is at https://github.com/zephyrproject-rtos/zephyr/pull/64314