5
This catches a numerical constant used as a loop condition. Instead of while
6
(true) or while (1), one should write for (;;). But it avoids catching some
7
cases that are used in macro definitions (see
8
[http://vivekkutal.blogspot.com/2006/03/do-while0.html]):
9
#define macro(...) do {...} while (false)
12
error_msg="Do not use numerical constants in loop condition!"
14
regexp =r"""(^.?|[^}].|.[^ ])while *\((true|false|(0x[[:xdigit:]]+|[[:digit:]]+)[Uu]?(L|l|LL|ll)?|[[:digit:]]*\.[[:digit:]]+[Ll]?)\)"""