Scope macros containing var initialisations#71
Scope macros containing var initialisations#71eelstork wants to merge 2 commits intogoogle:masterfrom eelstork:patch-1
Conversation
|
Note that these should probably use |
|
@longjon is right. Updated. |
|
build fails. |
|
@ukai thanks for looking at this; would it be meaningful to setup some kind of C.I. to help with similar issues? |
|
@ukai since scoping macro contents breaks uses of the insertion operator, I suggest using intermediate variables so that anonymous scopes can be narrowed (demonstrated in latest commit, passes tests). Help is needed regarding proper naming and namespace inclusion of |
There was a problem hiding this comment.
seems it makes LOG_EVERY macro thread unsafe?
|
@ukai thanks for reviewing this PR. Yes, I can see how this may affect thread safety. |
With some compilers declaring and initialising variables inside a switch may cause errors.
A real world example here.
Scoping these declarations solves the problem with hopefully no unwanted side effects.