-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Labels
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
v5.4
Operating System used.
Linux
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
What is the expected behavior?
should same to gcc, can compile successfully.
What is the actual behavior?
In the first, it will show no STDC_HOSTED, i see this is in CMakeLists.txt , and i try delete it, then show the error in PRIu64 like below.
the same project and same files, i can't use clang to build the idf project which include the espressif__cbor component, it will show the macro error in PRIu64
Steps to reproduce.
- create v5.4 project
- add espressif__cbor component
- build in esp-clang
...
Build or installation Logs.
<command line>:9:9: error: undefining builtin macro [-Werror,-Wbuiltin-macro-redefined]
9 | #undef __STDC_HOSTED__
After delete target_compile_options(${COMPONENT_LIB} PRIVATE "-U __STDC_HOSTED__"):
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cbortojson.c:356:36: error: expected ')'
356 | if (fprintf(out, "{\"tag%" PRIu64 "\":", tag) < 0)
| ^
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cbortojson.c:356:20: note: to match this '('
356 | if (fprintf(out, "{\"tag%" PRIu64 "\":", tag) < 0)
| ^
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cbortojson.c:364:40: error: expected ')'
364 | if (fprintf(out, ",\"tag%" PRIu64 "$cbor\":{", tag) < 0 ||
| ^
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cbortojson.c:364:24: note: to match this '('
364 | if (fprintf(out, ",\"tag%" PRIu64 "$cbor\":{", tag) < 0 ||
| ^
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cbortojson.c:423:21: error: call to undeclared function 'cbor_value_to_pretty_advance'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
423 | CborError err = cbor_value_to_pretty_advance(memstream, it);
| ^
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cbortojson.c:423:21: note: did you mean 'cbor_value_to_json_advance'?
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cborjson.h:50:20: note: 'cbor_value_to_json_advance' declared here
50 | CBOR_API CborError cbor_value_to_json_advance(FILE *out, CborValue *value, int flags);
| ^
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cbortojson.c:642:40: error: expected ')'
642 | r = fprintf(out, "%s%" PRIu64, val < 0 ? "-" : "", ival);
| ^
/home/gtc/workspace/S3project/managed_components/espressif__cbor/tinycbor/src/cbortojson.c:642:28: note: to match this '('
642 | r = fprintf(out, "%s%" PRIu64, val < 0 ? "-" : "", ival);
More Information.
No response


