Fix syntax inside switch#3365
Fix syntax inside switch#3365shelhamer merged 1 commit intoBVLC:masterfrom BonsaiAI:wrap-declarations-in-switch
Conversation
|
See #3130 as well. |
|
Note that, by my quick read of https://github.com/google/glog/blob/master/src/glog/logging.h.in, it looks like this issue only affects This feels like an upstream issue to me; in general, macros should behave like function calls. We could consider a workaround (e.g., a wrapper around
Sure it does, just as |
|
Raising an issue and suggesting a fix to the glog team. |
|
(closed by mistake; I wouldn't close this since I don't know whether it will be fixed in glog) |
|
With reference to google/glog#71 and google/glog#72, it appears that this can't be fixed in glog. @longjon, would you consider merging this? |
|
@shelhamer I agree with @eelstork the patch is needed for windows compatibility. The current state of the windows branch looks more like #3130 but this PR has only the required changes so if it was my call I would merge this one and close #3130 without merging it. Current windows branch also as a comment explaining the new scope creation see this comment. |
glog macros inside
switchcause the MSVC compiler to emit error C2360.I find that GCC may be lenient in this case; standards compliance should we require that we manually define scopes to declare and initialise variables within
casestatements.Additionally,
LOG(FATAL)doesn't exonerate us from the requirement tobreakaftercase.