I'm using code that defines loop macros like this:
#define FOR(i,n) for(unsigned i = 0; i < n; i++)
Unfortunately, these constructs do not get properly indented and line wrapped. I can redefine them when __CDT_PARSER__ is set to be
#define FOR(i,n) for(;;)
and then I get the proper indentation and line wrapping, but then i is no longer defined.
Any suggestions on how to get the desired behavior? Should I file a bug? This is version 8.1.1.201209170703.
#include <cstdio>
#define FOR(i,n) for(unsigned i = 0; i < n; i++)
#ifdef __CDT_PARSER__
#undef FOR
#define FOR(i,n) for(;;)
#endif
int main(int argc, char *argv[])
{
FOR(i, 5)
{
printf("%d\n", i);
}
}