Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CodeStyle - Indenting of Code Problem

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



Back to the top