GCC 14 adds -Wreturn-mismatch

This is just a heads-up that GCC 14 is going to add a -Wreturn-mismatch warning that has been split from the more fuzzy -Wreturn-types warning:

The plan is to turn -Wreturn-mismatch into an error by default for GCC 14, while leaving the rest of -Wreturn-type alone. This sort of matches Clang’s current behavior, which treats only those aspects of -Wreturn-type as errors by default.

2 Likes

Thank you for the heads up! Based on spot-checking the behavior, I think Clang should probably follow the same split in behavior as GCC.

I filed Modify -Wreturn-type and add -Wreturn-mismatch from GCC 14 · Issue #72116 · llvm/llvm-project · GitHub to track this so we don’t lose it.