[LLVMdev] fix warning with newer g++ compilers

Ralph Corderoy ralph at inputplus.co.uk
Sat Dec 15 04:16:17 PST 2007


Hi Mike,

> 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.

Cheers,


Ralph.




More information about the llvm-dev mailing list