[LyX/master] Work around compilation warning

Jean-Marc Lasgouttes lasgouttes at lyx.org
Mon Oct 11 12:28:50 UTC 2021


commit c242b2536401dc06ab5740d6c9c01013282ed795
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Fri Jul 16 18:27:15 2021 +0200

    Work around compilation warning
    
    Clang 12 (at least) misses the fact that tag is always initialized,
    because the if/else sequence does cover all cases.
    
    Initialize the variable although it is not required. It does not hurt
    at least.
---
 src/mathed/InsetMathScript.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mathed/InsetMathScript.cpp b/src/mathed/InsetMathScript.cpp
index 9f391f6..a5f286b 100644
--- a/src/mathed/InsetMathScript.cpp
+++ b/src/mathed/InsetMathScript.cpp
@@ -611,7 +611,7 @@ void InsetMathScript::mathmlize(MathMLStream & ms) const
 	if (!d && !u)
 		return;
 
-	const char * tag;
+	const char * tag = nullptr;
 	if (u && d)
 		tag = has_limits ? "munderover" : "msubsup";
 	else if (u)


More information about the lyx-cvs mailing list