I'm often use do-while(0) construct in my #defines, for the reasons described in this answer. Also I'm trying to use as high as possible warning level from compiler to catch more potential problem and make my code more robust and cross-platform. So I'm typically using -Wall
with gcc and /Wall
with MSVC.
Unfortunately MSVC complain about do-while(0) construct:
foo.c(36) : warning C4127: conditional expression is constant
What should I do about this warning?
Just disable it globally for all files? It does not seems to be good idea for me.