]> git.lyx.org Git - lyx.git/commitdiff
Work around compilation warning
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 16 Jul 2021 16:27:15 +0000 (18:27 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 11 Oct 2021 12:51:28 +0000 (14:51 +0200)
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

index 9f391f66f93e03dfb428a0f0f9eb00624ac9d939..a5f286b3a58528d20cad140f92b9469ea0e655c9 100644 (file)
@@ -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)