https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60725
--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> --- (In reply to Martin Sebor from comment #5) > Not to complicate things too much, but reaching the closing } of a non-void > function is valid in C. What is not valid (i.e., has undefined behavior) is > calling such a function and using its return value when none was provided > (as in the program in comment #3). The program in the Description, however, > has well-defined behavior because f1's return value isn't used. Good point. I don't know whether it is possible for the sanitizers to distinguish between the two cases. Pretty sure it is not possible for the warning code, since at the time of warning we know nothing of the callers (not even if there are any callers).