[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&);
- [lmi-commits] [lmi] master updated (68095897 -> 931cce6f), Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master 8b387bdc 1/6: Add "[[noreturn]]" in a few places,
Greg Chicares <=
- [lmi-commits] [lmi] master 9b175313 2/6: Enable '-Wconditional-uninitialized' for clang, Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master 931cce6f 6/6: Explain why several clang warnings are disabled, Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master d8bb7cb4 5/6: Repeat less, Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master 6f740381 3/6: Explain why '-Wfloat-conversion' is disabled for clang, Greg Chicares, 2022/07/09
- [lmi-commits] [lmi] master f7f9c1e7 4/6: Enable '-Wfloat-conversion' for clang: C only, Greg Chicares, 2022/07/09