Community
Participate
Working Groups
Build Identifier: 20110615-0604 After formatting the following array declarations the next statement is placed wrong: char szFirstBuffer[BUF_LENGTH + 1]; char szAffected[13]; char szUnaffected[13]; Becomes after formatting: char szFirstBuffer[BUF_LENGTH + 1];char szAffected[13]; char szUnaffected[13]; If a single-line comment is placed after the declaration, the formatted output becomes char szFirstBuffer[BUF_LENGTH + 1]; // additional char for termination char szAffected[13]; char szUnaffected[13]; If the size of the array is specified as a single token (i.e. [BUF_LENGTH] or [12]) everything the formatting is OK. I did not notice this behavior in Eclipse 3.6.2 (M20110210-1200) with CDT 7.0.2, earlier versions not tested. Reproducible: Always Steps to Reproduce: 1. In a C-source file, declare the following: char szFirstBuffer[BUF_LENGTH + 1]; char szAffected[13]; char szUnaffected[13]; 2. Format them using the code formatter
Fixed in master and 8.0.1.
*** cdt git genie on behalf of Anton Leherbauer *** Bug 350816 - [formatter] Fixed size array declaration formats wrong [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=3796041aa8daca55bcc693c3eb9d54fe70c17664
*** cdt git genie on behalf of Anton Leherbauer *** Bug 350816 - [formatter] Fixed size array declaration formats wrong [*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=0ab89e9c79b3724de8261906ed51a999efd80082