commit 37b9655f6e958bdd92bf8a362731d344bb0705db
Author: Scott Kostyshak <[email protected]>
Date: Sat Jul 5 18:38:03 2025 +0200
Fix some warnings from -Wmissing-noreturn
Fixing these warnings in theory allows the compiler to perform
optimizations.
This commit does not fix all such warnings. There are a couple
remaining ones to be addressed.
This commit fixes the following warnings:
src/support/lassert.cpp:85:1: warning: function 'doWarnIf' could be
declared with attribute 'noreturn' [-Wmissing-noreturn]
85 | {
| ^
src/support/lassert.cpp:95:1: warning: function 'doBufErr' could be
declared with attribute 'noreturn' [-Wmissing-noreturn]
95 | {
| ^
src/support/lassert.cpp:105:1: warning: function 'doAppErr' could be
declared with attribute 'noreturn' [-Wmissing-noreturn]
105 | {
| ^
src/LyX.cpp:438:1: warning: function 'earlyExit' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
438 | {
| ^
---
src/LyX.h | 2 +-
src/client/client.cpp | 2 +-
src/mathed/InsetMathUnknown.h | 4 ++--
src/mathed/InsetMathXYMatrix.h | 4 ++--
src/support/lassert.h | 6 +++---
5 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/LyX.h b/src/LyX.h
index cef580a92d..d6664e3439 100644
--- a/src/LyX.h
+++ b/src/LyX.h
@@ -80,7 +80,7 @@ private:
void prepareExit();
/// Early exit during the initialisation process.
- void earlyExit(int status);
+ [[noreturn]] void earlyExit(int status);
/// Initialise LyX and fills-in the vector of files to be loaded.
/**
diff --git a/src/client/client.cpp b/src/client/client.cpp
index 8d584d258f..a9be2d5785 100644
--- a/src/client/client.cpp
+++ b/src/client/client.cpp
@@ -452,7 +452,7 @@ void usage()
}
-int h(vector<docstring> const &)
+[[noreturn]] int h(vector<docstring> const &)
{
usage();
throw StopException(EXIT_SUCCESS);
diff --git a/src/mathed/InsetMathUnknown.h b/src/mathed/InsetMathUnknown.h
index a6efb161e0..5ea438f4bd 100644
--- a/src/mathed/InsetMathUnknown.h
+++ b/src/mathed/InsetMathUnknown.h
@@ -48,9 +48,9 @@ public:
///
void mathematica(MathematicaStream &) const override;
///
- void mathmlize(MathMLStream &) const override;
+ [[noreturn]] void mathmlize(MathMLStream &) const override;
///
- void htmlize(HtmlStream &) const override;
+ [[noreturn]] void htmlize(HtmlStream &) const override;
///
void octave(OctaveStream &) const override;
///
diff --git a/src/mathed/InsetMathXYMatrix.h b/src/mathed/InsetMathXYMatrix.h
index cedd0601e9..ccc2b5539f 100644
--- a/src/mathed/InsetMathXYMatrix.h
+++ b/src/mathed/InsetMathXYMatrix.h
@@ -49,9 +49,9 @@ public:
///
InsetCode lyxCode() const override { return MATH_XYMATRIX_CODE; }
///
- void mathmlize(MathMLStream &) const override;
+ [[noreturn]] void mathmlize(MathMLStream &) const override;
///
- void htmlize(HtmlStream &) const override;
+ [[noreturn]] void htmlize(HtmlStream &) const override;
private:
///
diff --git a/src/support/lassert.h b/src/support/lassert.h
index 2d53a3b52f..ba3b7b65d1 100644
--- a/src/support/lassert.h
+++ b/src/support/lassert.h
@@ -67,9 +67,9 @@ LAPPERR(expr)
void doAssert(char const * expr, char const * file, long line);
void doAssertStatic(char const * expr, char const * file, long line);
-void doWarnIf(char const * expr, char const * file, long line);
-void doBufErr(char const * expr, char const * file, long line);
-void doAppErr(char const * expr, char const * file, long line);
+[[noreturn]] void doWarnIf(char const * expr, char const * file, long line);
+[[noreturn]] void doBufErr(char const * expr, char const * file, long line);
+[[noreturn]] void doAppErr(char const * expr, char const * file, long line);
void doAssertWithCallstack(bool value);
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs