Discussion:
PATCH: InsetMathXArrow uninitialized variable read
Stephan Witt
2014-08-31 10:49:59 UTC
Permalink
I've attached a possible fix for
src/mathed/InsetMathXArrow.cpp:157:11: Variable 'arrow' is used uninitialized whenever 'if' condition is false

It's not my play ground. But I don't like to see these warnings for ever.

Does anyone of the more involved developers has a comment or should I commit this change?

Stephan
Richard Heck
2014-09-01 14:56:42 UTC
Permalink
Post by Stephan Witt
I've attached a possible fix for
src/mathed/InsetMathXArrow.cpp:157:11: Variable 'arrow' is used uninitialized whenever 'if' condition is false
It's not my play ground. But I don't like to see these warnings for ever.
Does anyone of the more involved developers has a comment or should I commit this change?
I would only add

LATTEST(false);

in both cases. This will assert in development mode and do nothing in
release mode. Or we could do:

LASSERT(false, arrow = "→");

instead, which would have the same effect. The assertion seems right,
since it is then a programming error.

Richard
Stephan Witt
2014-09-02 22:08:55 UTC
Permalink
Post by Richard Heck
Post by Stephan Witt
I've attached a possible fix for
src/mathed/InsetMathXArrow.cpp:157:11: Variable 'arrow' is used uninitialized whenever 'if' condition is false
It's not my play ground. But I don't like to see these warnings for ever.
Does anyone of the more involved developers has a comment or should I commit this change?
I would only add
LATTEST(false);
LASSERT(false, arrow = "→");
instead, which would have the same effect. The assertion seems right, since it is then a programming error.
Richard
Ok, thanks. It's in.

Stephan

Loading...