[clang] [compiler-rt] [Clang] Make `-Wreturn-type` default to an error in all language modes (PR #123470)

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 09:17:57 PST 2025


AaronBallman wrote:

> > Existing code already uses `-Wreturn-type` though, and this patch is enabling it in all language modes, not just C23 and above.
> 
> At least that’s what I hope we’ll be able to do. A compromise would be to only enable it in e.g. C23/C++26/whatever, but that doesn’t quite seem satisfactory to me...

Yeah, the goal is to improve safety and security, and so I think it makes sense to aim for enabling this in all language modes. Even if we enable it only in C23 or later as a fallback, it still means projects will struggle to upgrade to the latest C standard, so it's better for us to try to address as many pain points as we can so that migration path is easier for users.

https://github.com/llvm/llvm-project/pull/123470


More information about the llvm-commits mailing list