Please review a patch to add clang's invalid-noreturn flag to toggle
noreturn  warnings. This patch keeps the old behaviour of always warning on
every noreturn violation, but unlike clang also adds an extra layer of fine
tuning by turning invalid-noreturn into a warning with levels, where level
1 warns about noreturn functions that do return, level 2 warns about
noreturn functions that explicitly have return statements, and level 3,
which is the default to match old behaviour, warns for both instances. I am
under the impression that behaviour changing patches should be sent to this
list rather than gcc-patches, please do correct me if I am mistaken

 gcc/c-family/c.opt     |  8 ++++++++
 gcc/c/c-typeck.cc      |  9 ++++++---
 gcc/c/gimple-parser.cc |  9 ++++++---
 gcc/cp/coroutines.cc   | 11 +++++++----
 gcc/cp/typeck.cc       |  7 +++++--
 gcc/tree-cfg.cc        |  5 ++++-
 6 files changed, 36 insertions(+), 13 deletions(-)

Attachment: 0001-Add-the-invalid-noreturn-warning-to-match-clang.patch
Description: Binary data

Reply via email to