To my knowlegde carbide.c++ 1.2.2 code formatter cannot format code so that it is compatible with Nokia "S60 Coding Conventions".
This is a problem because when one presses ctrl-shift-f to auto-format code, the code will be corrupted to non-standard state. We cannot really change coding conventions to match IDE bugs.
I've modified the formatting definitions to best match S60 code style. After tweaking, following major problems remain in two categories:
1) Auto-formatter messes with existing code, and corrupts the formatting
2) Auto-formatter doesn't mess with existing code, but doesn't do the correct formatting either
To demostrate category 1 problem, see this:
I want this:
I get this:
TInt a( 3 );
Test( a );
Test( TInt( a ) );
void CFoo::Foo( )
Test( a ); // this is the only correct thing
Test(TInt( a ));
- Method definition without parameters has incorrectly space between parens
- TInt a(3) is not correctly formatted to have spaces
- Method invication without parameters has incorrectly space between parens
- When TInt( a ) is defined as only parameter to Test, there is no spaces between parens. Things work if Test takes two or more parameters, then the TInt( a ) has proper spaces between parens and commas ( Test( TInt( a ), TInt( a ) ); ).
Category 2 problem example.
Let assume if I have code like this.
When auto-format is applied, the code looks the same.
TInt foo = static_cast<TInt>(3);
If I add manually the spaces around parens, the auto-formatter won't touch those. So if the code is correct, the auto-formatter won't corrupt it, but if it is wrong, it won't do the right thing either.
One minor bug:
setting variable: keep_empty_array_initializer_on_one_line
- no effect, it splits empty array initializer to multiple lines anyway
This is the formatter setting .xml that I've used: http://ssalmine.googlepages.com/symb...ersettings.xml