Code review - Issue 561290043: Issue 5309, take 2: find_global_context () and find_score_context ()https://codereview.appspot.com/2020-01-03T21:21:33+00:00rietveld
Message from unknown
2020-01-03T15:59:51+00:00Dan Ebleurn:md5:be97eabe0cc3a2bba56f6122e6c5d5b5
Message from lemzwerg@googlemail.com
2020-01-03T16:18:10+00:00lemzwergurn:md5:52cb1d27a773278fd7b8a8164df1af33
LGTM, thanks!
https://codereview.appspot.com/561290043/diff/583280043/lily/context.cc
File lily/context.cc (right):
https://codereview.appspot.com/561290043/diff/583280043/lily/context.cc#newcode116
lily/context.cc:116: if (Context *score = gthis->get_score_context ())
Not sure whether compilers warn about the `if (... = ...)` construct. Perhaps the `Context *` prevents it. Otherwise I suggest another level of parentheses.
Message from nine.fierce.ballads@gmail.com
2020-01-03T16:34:14+00:00Dan Ebleurn:md5:7120a1d7e8a208d5edd6a3f6f73fca5a
On 2020/01/03 16:18:10, lemzwerg wrote:
> lily/context.cc:116: if (Context *score = gthis->get_score_context ())
> Not sure whether compilers warn about the `if (... = ...)` construct. Perhaps
> the `Context *` prevents it. Otherwise I suggest another level of parentheses.
I've compiled context.o with "-Wall -Wextra" with g++ 9.2.1, and there is no complaint.
Message from dak@gnu.org
2020-01-03T21:21:33+00:00dakurn:md5:9f638c6be8982e34c9d8881b0bd3d25a
https://codereview.appspot.com/561290043/diff/583280043/lily/context.cc
File lily/context.cc (right):
https://codereview.appspot.com/561290043/diff/583280043/lily/context.cc#newcode116
lily/context.cc:116: if (Context *score = gthis->get_score_context ())
On 2020/01/03 16:18:09, lemzwerg wrote:
> Not sure whether compilers warn about the `if (... = ...)` construct. Perhaps
> the `Context *` prevents it. Otherwise I suggest another level of parentheses.
They don't. lily/parser.yy is full of it (and a number of other files as well) and I have no idea where you want to place "another level of parentheses". It certainly is not allowed around the declaration.