/Volumes/mrs5/net/llvm/llvm/llvm/lib/AsmParser/LLLexer.cpp: In member function 'int llvm::LLLexer::LexAt()':
/Volumes/mrs5/net/llvm/llvm/llvm/lib/AsmParser/LLLexer.cpp:287: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement
/Volumes/mrs5/net/llvm/llvm/llvm/lib/AsmParser/LLLexer.cpp: In member function 'int llvm::LLLexer::LexPercent()':
/Volumes/mrs5/net/llvm/llvm/llvm/lib/AsmParser/LLLexer.cpp:338: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement
/Volumes/mrs5/net/llvm/llvm/llvm/lib/AsmParser/LLLexer.cpp: In member function 'int llvm::LLLexer::LexDigitOrNegative()':
/Volumes/mrs5/net/llvm/llvm/llvm/lib/AsmParser/LLLexer.cpp:720: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement
/Volumes/mrs5/net/llvm/llvm/llvm/lib/AsmParser/LLLexer.cpp: In member function 'int llvm::LLLexer::LexPositive()':
/Volumes/mrs5/net/llvm/llvm/llvm/lib/AsmParser/LLLexer.cpp:789: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement
The usual style is to put a space before the ;, or put the ; on a new line to visually separate the ; from the for statement, so that the follow like doesn't look like it goes with the for.
The usual style is to put a space before the ;, or put the ; on a new
line to visually separate the ; from the for statement, so that the
follow like doesn't look like it goes with the for.
The "usual" styles I'm used to seeing, dating back almost 20 years, are
the semi-colon up tight to the closing parenthesis, as LLLexer.cpp has,
or
for (fee(); fie(); foe()) {
/* Do nothing. */
}
However, I see indent(1) has a -ss option to insert a single space
before the semi-colon so the convention must have been around a while.
Personally, I think the lack of a following indented statement or block
makes it clear to look for the semi-colon if it hasn't already been
spotted and the warning's overkill.
Thanks for the patch. It doesn't apply because your mailer included it inline. If you're using the apple mailer, putting a .patch suffix on it (instead of .txt) might help.
w.r.t the debate, I'd prefer:
for (++CurPtr; isdigit(CurPtr[0]); ++CurPtr)
/*empty*/;