lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 8b387bdc 1/6: Add "[[noreturn]]" in a few pla


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 8b387bdc 1/6: Add "[[noreturn]]" in a few places
Date: Sat, 9 Jul 2022 18:28:39 -0400 (EDT)

branch: master
commit 8b387bdcd95b64f5ccfa30b6743468dae661a1c0
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Add "[[noreturn]]" in a few places
    
    It's useful occasionally to enable the gcc and clang warning options
    that suggest "[[noreturn]]", but the suggestions may be inadvisable.
---
 compiler_clang_warnings.make | 2 +-
 compiler_gcc_warnings.make   | 2 +-
 handle_exceptions.hpp        | 1 +
 skeleton.hpp                 | 2 ++
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/compiler_clang_warnings.make b/compiler_clang_warnings.make
index 3ea918d5..2933be24 100644
--- a/compiler_clang_warnings.make
+++ b/compiler_clang_warnings.make
@@ -68,7 +68,7 @@ clang_c_warnings := \
 ###  -Wglobal-constructors
 # -Wlogical-op-parentheses: && is multiplicative; || is additive
 # -Wmismatched-tags: stylistic freedom--not a defect
-###  -Wmissing-noreturn
+# -Wmissing-noreturn: use occasionally; beware false positives
 ###  -Wmissing-prototypes
 ###  -Wmissing-variable-declarations
 # -Wpadded: useful only for low-level work
diff --git a/compiler_gcc_warnings.make b/compiler_gcc_warnings.make
index 546f4950..d2ed5fd2 100644
--- a/compiler_gcc_warnings.make
+++ b/compiler_gcc_warnings.make
@@ -59,7 +59,7 @@ endif
 # -Wparentheses: its diagnostics are beyond pedantic
 # -Wpsabi: undocumented--ARM only?
 # -Wsign-conversion: [see note elsewhere in this file]
-# -Wsuggest-attribute: too gcc-specific
+# -Wsuggest-attribute: use occasionally; beware false positives
 # -Wsystem-headers: not generally useful
 # -Wswitch-default: false positives for switches on enums that
 #   include all cases (verified by -Wswitch-enum)
diff --git a/handle_exceptions.hpp b/handle_exceptions.hpp
index cfbfcfed..b049824a 100644
--- a/handle_exceptions.hpp
+++ b/handle_exceptions.hpp
@@ -33,6 +33,7 @@
 /// This function, of type std::terminate_handler, is intended to be
 /// used as the argument of std::set_terminate().
 
+[[noreturn]]
 inline void lmi_terminate_handler()
 {
     safely_show_message
diff --git a/skeleton.hpp b/skeleton.hpp
index 1250202c..9673a2f3 100644
--- a/skeleton.hpp
+++ b/skeleton.hpp
@@ -109,7 +109,9 @@ class Skeleton
     void UponTestLibWarning               (wxCommandEvent&);
     void UponTestLibHobsons               (wxCommandEvent&);
     void UponTestLibFatal                 (wxCommandEvent&);
+    [[noreturn]]
     void UponTestLibStandardException     (wxCommandEvent&);
+    [[noreturn]]
     void UponTestLibArbitraryException    (wxCommandEvent&);
     void UponTestLibCatastropheReport     (wxCommandEvent&);
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]