Open weiqj opened 1 year ago
Normally this should work if we properly detect your compiler as being "gcc" (your logging indicates we are not). Can you try adding defines like the ones below
"__GNUC__=10",
"__GNUC_MINOR__=4",
"__GNUC_PATCHLEVEL__=0"
Normally this should work if we properly detect your compiler as being "gcc" (your logging indicates we are not). Can you try adding defines like the ones below
"__GNUC__=10", "__GNUC_MINOR__=4", "__GNUC_PATCHLEVEL__=0"
Thanks for your quick response. I added the defines. Unfortunately, it still doesn't work.
@sean-mcmanus One more question. Was my code snippet parsed correctly on your VSCode?
Yes, it works for me (even with out the defines I mentioned previously), i.e. I see
other: --gcc
other: --gnu_version=103000
but for some reason those are missing from your logging, which I believe is what is causing the __attribute__
to incorrectly not be recognized.
What shall I put into c_cpp_properties.json? I am using arm-none-eabi-gcc for embedded MCU development.
I'm not sure yet. We may be able to investigate more next week.
Appreciate your effort very much!
This is ridiculous. I removed the nordic library from the includePath, then the parser worked.
But this morning, Ubuntu automatically updated VSCode to the latest version. It no longer works, with a warning: variable "uint8_t" is not a type name.
@weiqj That sounds like a different issue (are you able to provide more info?). Updates to VS Code itself generally should not affect our extension's IntelliSense results so you should check the version of the C/C++ extension being used.
@sean-mcmanus : not sure if this is still valid, i can create a new issue if you like. Yes the uint8_t comes from intellisense not giving valid defines to all include files which are integrated into the GCC. The problem arises from these lines in stdint.h which need them:
#ifdef __UINT8_TYPE__
typedef __UINT8_TYPE__ uint8_t;
#endif
#ifdef __UINT16_TYPE__
typedef __UINT16_TYPE__ uint16_t;
#endif
#ifdef __UINT32_TYPE__
typedef __UINT32_TYPE__ uint32_t;
#endif
#ifdef __UINT64_TYPE__
typedef __UINT64_TYPE__ uint64_t;
#endif
after putting these #defines into intelisense config:
"defines": [
"__UINT_LEAST16_MAX__=65535",
"__UINT_LEAST8_TYPE__=unsigned char",
"__UINT8_MAX__=255",
"__UINT_FAST64_MAX__=18446744073709551615ULL",
"__UINT_FAST8_MAX__=4294967295U",
"__UINT_LEAST64_MAX__=18446744073709551615ULL",
"__UINT_LEAST8_MAX__=255",
"__UINTMAX_TYPE__=long long unsigned int",
"__UINT32_MAX__=4294967295UL",
"__UINT16_C(c)=c",
"__UINT16_MAX__=65535",
"__UINT8_TYPE__=unsigned char",
"__UINT64_C(c)=c ## ULL",
"__UINT_LEAST16_TYPE__=short unsigned int",
"__UINT64_MAX__=18446744073709551615ULL",
"__UINTMAX_C(c)=c ## ULL",
"__UINT_FAST32_MAX__=4294967295U",
"__UINT_LEAST64_TYPE__=long long unsigned int",
"__UINT_FAST16_TYPE__=unsigned int",
"__UINT_LEAST32_MAX__=4294967295UL",
"__UINT16_TYPE__=short unsigned int",
"__UINTPTR_MAX__=4294967295U",
"__UINT_FAST64_TYPE__=long long unsigned int",
"__UINT_LEAST32_TYPE__=long unsigned int",
"__UINT8_C(c)=c",
"__UINT64_TYPE__=long long unsigned int",
"__UINT32_C(c)=c ## UL",
"__UINT_FAST32_TYPE__=unsigned int",
"__UINTMAX_MAX__=18446744073709551615ULL",
"__UINT32_TYPE__=long unsigned int",
"__UINTPTR_TYPE__=unsigned int",
"__UINT_FAST16_MAX__=4294967295U",
"__UINT_FAST8_TYPE__=unsigned int"
],
will fix this issue.
but the attribute i also still have:
__attribute__((used, section(".requests")))
static volatile LIMINE_BASE_REVISION(2);
gives two errors: attribute -> explicit type is missing ('int' assumed)C/C++(260) static ->expected a '{'C/C++(130)
im just fiddling around with the template from here in vcode:
https://github.com/limine-bootloader/limine-c-template
you just need to run make once to get the header files (stdint etc.). after that. you can see the intellisense errors in the kernel/src/kernel.c file. compilation runs without errors.
Environment
Bug Summary and Steps to Reproduce
Bug Summary:
Steps to reproduce:
Expected behavior: The code compiles fine.
But Intellisense reports an error: [{ "resource": "/home/weiqj/workspace/hornet/src/core/net/cluster_lib/libertas_cluster_base.h", "owner": "C/C++: IntelliSense", "code": "79", "severity": 8, "message": "expected a type specifier", "source": "C/C++", "startLineNumber": 57, "startColumn": 1, "endLineNumber": 57, "endColumn": 18 }]
Configuration and Logs
Other Extensions
No response
Additional context
No response