Using a semicolon right after the conditional statement (for example an if
,
for
, while
, etc.) indicates that nothing happens if the predicate is true.
Though this is sometimes intentional, but at other times this might also
indicate a possible miss by the programmer, specially when the following lines
of code have specific traits (like indentation matching that of the conditional
block).
If the semicolon after the conditional statements is intentional, consider moving the semicolon to the next line or indent the following code block/line with that of the conditional.
while ((l = readLine(fileHandle)) != NULL); // unintended semicolon
comsumeLine(l);
while ((skipSpaces(line));
readLine(line);
while ((l = readLine(fileHandle)) != NULL)
comsumeLine(l);
while ((skipSpaces(line));
readLine(line);
// OR
while ((skipSpaces(line))
;
readLine(line);