erigontech / erigontech/silkworm

Allow custom attributes on clang-coverage

Open
#413 4 comments 0 reactions 0 assignees View on GitHub
style
Dominant language
C++
Stars
318
Forks
84
PR merge metrics
No merged PRs in 30d

Description

**C++17 [states](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0283r2.html) that the compiler must ignore unknown attributes.**
This allows the users to annotate the code to convey more semantics or to use custom code analysis and manipulation tools.
Also attributes cannot alter code semantics, so user defined attributes not recognized by the compiler can be safely ignored.

I found useful to annotate with a custom attribute `[[long_running]]` some methods that do not return immediately because they have a potentially infinite loop (i.e. gRPC stream reading loop) like this:

`[[long_running]] void receive_messages(MessageQueue& messages, std::atomic& stopping);`

The standard [[noreturn]] attribute is not adequate here because the method returns when it receives a stop signal.

But clang-coverage complains about unknown attributes.

I am proposing to allow custom attributes or at least custom attributes in the silkworm namespace: `[[silkworm::long_running]]`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.