CHERIoT-Platform/llvm-project

Warn if compartment call returns void

Open

#34 opened on Jul 3, 2024

View on GitHub
 (11 comments) (0 reactions) (0 assignees)LLVM (15 forks)auto 404
good first issue

Repository metrics

Stars
 (9 stars)
PR merge metrics
 (PR metrics pending)

Description

It would be good if clang would warn if the return type of a compartment call is void. Compartment calls can fail unexpectedly and return -1 (e.g. due to trusted stack exhaustion). Callers should be aware of and check for this, therefore it is never appropriate for a compartment call to return void. For the same reason we should also consider automatically adding the nodiscard attribute to compartment calls.

Contributor guide