I was trying to reproduce this behaviour with the similar headers!
Build is fine - this is an IDE indexer (clangd) false error, not a real compile issue.
How to fix:
- update .clangd to avoid this false-positive escalation:
Code: Select all
CompileFlags:
CompilationDatabase: build
Remove: [-m*, -f*]
Add: [-Wno-attributes, -Wno-ignored-attributes]
Diagnostics:
Suppress: [attribute_not_type_attr]What's happening:
- ESP-IDF uses the Xtensa GCC toolchain and compiles successfully.
- clangd (used for editor diagnostics) parses some picolibc headers differently.
- In pthread.h, clangd misinterprets __noreturn and reports:'noreturn' attribute cannot be applied to types. Because warning policy includes -Werror, clangd shows it like a hard error near <iostream>
.
