In an embedded riscv32 mcu's sdk I see the follow function overloading practice:
void FLASH_ROM_READ(uint32_t StartAddr, void *Buffer, uint32_t len);void FLASH_ROM_READ(UINT32 StartAddr, PVOID Buffer, UINT32 len);
gcc compiles it fine. They are using riscv64-elf-gcc -march=rv32imac_zicsr -mabi=ilp32 -msmall-data-limit=8
compiler call in their makefile. And it sucessfully compiles.
However in my editor's (neovim) LSP (clangd) I get errors:
In included file: conflicting types for 'FLASH_ROM_READ'[Ln 29, Col 6]Error occurred here[Ln 29, Col 6]Previous declaration is here
How do I get the LSP to not raise this error?
EDIT - Here is my project structure
- {root} - vendor-lib - apps - hello-app - Makefile - compile_commands.json - src main.c - out
I think the problem is that vim/LSP doesn't honour the includes when I open library files. Do I have to generate another compile_commands.json
at project root? If so how do I do that?
EDIT2: Actually it's not able to recognise these types uint32_t
etc, inside header files, both in project and library folder..