Template with C linkage in util.h:52 #23850
Labels
bug
The issue is a bug, or the PR is fixing a bug
platform: nRF
Nordic nRFx
priority: low
Low impact/importance bug
Maybe I can shed some light on the issue described in #9590 (closed by lack of information) here, as I'm currently facing a similar one if not exactly the same.
The problem is that this file defines a template if the user Is building a C++ application as I'm currently doing.
Someone (in my case, nordic hal) will include some of the zephyr headers within "extern C { }" blocks, thus, provoking a compilation error.
I my specific scenario. This is derived from the following inclusion trace:
Being the key inclusion <irq.h> on nrfx_glue.h:69
If this inclusion is commented out. The project will build. But would be nice to not depend on this ad-hoc solution.
I was thinking about opening this issue on the HAL repository. But Since zephyr is written in C. Is not unlikely that people will add zephyr headers within "extern C" block. So probably is something that should be addressed also here. (Even if the addressing means a big red warning for "do not use "extern C" blocks in this fashion!" on the documentation)
Environment (please complete the following information):
cat VERSION
VERSION_MAJOR = 2
VERSION_MINOR = 2
PATCHLEVEL = 0
VERSION_TWEAK = 0
EXTRAVERSION = rc3
The text was updated successfully, but these errors were encountered: