Bug 120357

Summary: The formatter squashes indentation to the far left in the #else section of a #ifdef #else #endif sequence.
Product: [Applications] kdevelop Reporter: Robert Shideleff <bigbob>
Component: AstyleAssignee: kdevelop-bugs-null
Status: RESOLVED LATER    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Robert Shideleff 2006-01-18 00:47:13 UTC
Version:           3.3 (using KDE 3.4.3, Gentoo)
Compiler:          gcc version 3.4.4 (Gentoo 3.4.4-r1, ssp-3.4.4-1.0, pie-8.7.8)
OS:                Linux (x86_64) release 2.6.14.2

The short description says it all. Create a file with the following:

>>>>>Begin Snippet>>>>>>
#ifdef A
main(void)
{}
#else
main(void)
{
#ifdef A
    testfuncA();
#else
testfuncB();
#endif
}
#endif
<<<<<<End Snippet<<<<<<<

And the auto formatter will format it as shown above. The testfuncB() should be indentted equal to testfuncA(). Instead it is squashed over to the left.
Comment 1 Megan Webb 2006-12-04 13:31:54 UTC
The formatter in kdevelop is using astyle 1.19 now. But this version of astyle does not do much with macros.