Cross compile project throws errors such as "unknown register name 'r0' in asm"
I'm using cmake for compiling ARM cortex-M4 binaries. However, cquery sometimes shows red underline on assembly codes which use ARM-specific registers. Is it came from that cquery uses clang, instead of arm-none-eabi-gcc? Then is there any configuration to select specific compiler?
Also, every
#ifdef __cplusplus
extern "C" {
#endif
causes "expected identifier or '('" error.
Furthermore, it cannot resolve gnu primitive definition, such as __attribute__((weak)).
Does your code compile in clang? cquery uses clang under the hood, so compilation with clang is a requirement.
Thank you for responding! Okay, got it. As the cmake project uses gcc arm toolchain, I just wonder if it is possible to lint with arm compiler, rather than clang. So, will it be any chance to use arm gcc toolchain or arm cross compile clang for linting? Or, is it impossible due to technical issues?
Sorry, this is not possible. cquery is based on libclang APIs, which contains detail that gcc developers do not expose.