[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [cdt-dev] CodeStyle - Indenting of Code Problem
|
It probably doesn't understand that it's dealing with a function definition since FUNC(void, MYMODULE_CODE) doesn't look like return type. You can debug this issue by stepping through the auto-indenter code (org.eclipse.cdt.internal.ui.text.CIndenter and org.eclipse.cdt.internal.ui.text.CHeuristicScanner).
-sergey
On Mon, Feb 28, 2011 at 11:26 AM, kesselhaus
<kesselhaus@xxxxxxx> wrote:
Well, I accept argument of not using the AST for performance reason,
but indenting a opening brace on a function (top scope in file), why
does it indent at the end of void?
Where does the difference in indentation come from, as it should be
level 0?
Am
27/02/2011 23:58, schrieb Sergey Prigogin:
For performance reasons auto-indenter cannot use AST
and is not aware of macros. It's not surprising that it gets
confused by
FUNC(void, MYMODULE_CODE) MyMod_Function(void)
-sergey
On Sun, Feb 27, 2011 at 12:46 PM,
kesselhaus
<kesselhaus@xxxxxxx>
wrote:
Hi folks,
I encounter a problem of indentation, but maybe there is an
way to configure it and I did not find yet.
void foo(void)
{ /*<-- nicely indented */
/* do something */
}
AUTOSAR code, which uses some macros for compiler
independent memory mapping:
#if (COMPILER == XY)
#define FUNC(rettype, memoryclass) __declspec(memoryclass)
rettype /* adaption to compiler XY */
#else
#define FUNC(rettype, memoryclass) rettype /* default,
no adaption */
#endif
FUNC(void, MYMODULE_CODE) MyMod_Function(void) /* this
would become with XY __declspec(MYMODULE_CODE) void
MyMod_Function(void) */
{ /*<-- indentation wrong, should start
in column 1 */
/* do something */
}
So, is there a way to handle such code, or is this currently
a bug of whatever does this in CDT?
Regards,
Henning
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev