cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

extend zephyr.cfg

Open koalatux opened this issue 1 year ago • 6 comments

add some often used macros to zephyr.cfg

koalatux avatar Dec 09 '24 14:12 koalatux

Reference: https://docs.zephyrproject.org/apidoc/latest/group__log__api.html

firewave avatar Dec 09 '24 15:12 firewave

I think it would make sense to add some blurb on why (performance? bugs?) those lines have been added. "Often used" applies to many macros.

rettichschnidi avatar Dec 10 '24 16:12 rettichschnidi

Unknown macros often lead to ... unknownMacro errors (no surprise there). Is there a platform in our CI where a test file zephyr.cpp could be compiled?

chrchr-github avatar Dec 11 '24 13:12 chrchr-github

hmm I am currently taking a closer look zephyr analysis also. If the approach is to include the zephyr headers. Maybe the future advice will be to include the zephyr headers... then no macros will be needed in the zephyr.cfg. However for the function configurations to work properly we will need to make some tweaks in Cppcheck..

danmar avatar Dec 12 '24 09:12 danmar

These additions helped me to fix most of the hints displayed by cppcheck in our Zephyr project. I only had to provide two or three specific --suppress options.

Including the Zephyr source code in the check would be nice, too, but I guess there is quite some work to do until all hints in Zephyr itself will be fixed. Also if you are stuck with an older Zephyr version, an updated zephyr.cfg might be helpful.

koalatux avatar Dec 12 '24 16:12 koalatux

but I guess there is quite some work to do until all hints in Zephyr itself will be fixed

yes but I feel I have made good progress in last week in the simplecpp repo. Nothing of that is used in Cppcheck repo yet though.

I would like to continue the discussion about how to configure zephyr properly. I will continue to make preprocessor/parser fixes so I hope it will work a lot better in 1-2 weeks. And then we can discuss how zephyr.cfg can be improved.

feel free to contact me at the support email.

danmar avatar Dec 15 '24 09:12 danmar