Bug 114687

Summary: Source formatter messes up literal arrays and compounds
Product: [Applications] kdevelop Reporter: Gunther Piez <gpiez>
Component: AstyleAssignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Gunther Piez 2005-10-19 15:15:51 UTC
Version:            (using KDE KDE 3.4.92)
Installed from:    Gentoo Packages

Example:

struct foo {
	int x;
	char y;
};

int main() {
	int a = (int[]) { 1,2,3 } [2];
	foo b = (foo) { 4711, 'b' };
}


becomes


struct foo {
	int x;
	char y;
};

int main() {
	int a = (int[]) {
		        1,2,3
	        }
	        [2];
	foo b = (foo) {
		        4711, 'b'
	        };
}

This is very ugly, especially when used in function calls, where literals are most useful.
Comment 1 Matt Rogers 2005-10-20 02:10:07 UTC

*** This bug has been marked as a duplicate of 108666 ***
Comment 2 Gunther Piez 2005-10-20 15:18:58 UTC
Sure this is a duplicate?
Here some new lines are introduced, but the program stays the same. In 108666 the contents of a string and the program is changed.

But http://bugs.kde.org/show_bug.cgi?id=71574 is probably the same bug.

Or is every "astyle messes up something" considered to be the same bug? :-)