In C23 you can use the attribute
[[nodiscard]]
on functions to mark that the result from function shouldn't be discarded.
I think there is also a [[reproducible]]
attribute for saying a function doesn't do side effects.