https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127091
Bug ID: 127091
Summary: Feature request: Add a warning flag for _any_ function
call with unused result
Product: gcc
Version: 16.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: contact at ivanchev dot net
Target Milestone: ---
This would be incredibly useful for raising the code quality of a product
(think unchecked mallocs and such) and is a great feature in Rust. While I
wouldn't force it, it's nice if I'm able to get warnings for every function
call where the result is unused. Currently I have to add attributes manually
which for a large code base is unfeasible.