Skip to content

Difficultuies using clangd #1288

@diggit

Description

@diggit

Hi,
I am using clangd extension in the vscode, because it is OSS, but mainly is can handle large projects with good performance.

First issue is that modm copies only gcc related cmsis sources, because only those are listed in here https://github.com/modm-io/modm/blob/develop/ext/arm/core.lb

There also an issue with partial template specialization, but that could be clang issue llvm/llvm-project#156242
(According to GH copilot, the code is not valid, but GCC is permissive. Offered solution is not complex, but I am not sure how modm feels about LLM generated code...)

Then there is a collision of modm __atomic_is_lock_free and clangs builtin function.
Why does modm have to re-implement from standard library anyway? Is that because of AVRs? I've been using standard library for quite some on cortex-m device without issues.

modm iostream compilation fails on operator re-declaration. It looks like this statement is not true with clang: https://godbolt.org/z/br9db9n6a

this could be a solution

	template<bool enable = not std::is_same_v<int, int32_t>>
	inline std::enable_if_t<enable, IOStream>& operator << (const int& v)
	{ writeIntegerMode(static_cast<int32_t>(v)); return *this; }
	template<bool enable = not std::is_same_v<unsigned int, uint32_t>>
	inline std::enable_if_t<enable, IOStream>& operator << (const unsigned int& v)
	{ writeIntegerMode(static_cast<uint32_t>(v)); return *this; }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions