You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fixes a compiler error when building C++ projects that use the
'modules' C++ language feature consume Mbed TLS. The specific error is
module-import-in-extern-c, which occurs when `#include`s occur within
`extern C` blocks.
```
$ clang-17 -std=c++20 -fmodules -Itf-psa-crypto/include -Itf-psa-crypto/drivers/builtin/include -o sample sample.cpp
In file included from sample.cpp:8:
In file included from tf-psa-crypto/drivers/builtin/include/mbedtls/private/chachapoly.h:44:
tf-psa-crypto/drivers/builtin/include/mbedtls/private/chacha20.h:26:1: error: import of C++ module '_Builtin_stdint' appears within extern "C" language linkage specification [-Wmodule-import-in-extern-c]
26 | #include <stdint.h>
| ^
tf-psa-crypto/drivers/builtin/include/mbedtls/private/chachapoly.h:35:1: note: extern "C" language linkage specification begins here
35 | extern "C" {
| ^
1 error generated.
```
This seems to primarily be an issue with clang. See
https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fmodules
0 commit comments