Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 359658 - CDT: code formatter does not work as expected when complicate macro precedes formatted code
Summary: CDT: code formatter does not work as expected when complicate macro precedes ...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-editor (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 8.0.2   Edit
Assignee: Anton Leherbauer CLA
QA Contact: Anton Leherbauer CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-02 07:08 EDT by Yonatan CLA
Modified: 2011-10-10 09:23 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yonatan CLA 2011-10-02 07:08:19 EDT
Build Identifier: 20110615-0604

When the below "if..." is formmated (using ctrl-shift F):

#define TESTING(m) ;do{}while(0)

    TESTING(1);

    if(    Test(a    ) != 1)
    {
        status = ERROR;
    }

The result is 

    if(    Test(a ) != 1)
    {   
        status = ERROR;
    }

where as, when the code does not have the macro like so:

#define TESTING(m) ;do{}while(0)

    //TESTING(1);

    if(    Test(a ) != 1)
    {
        status = ERROR;
    }

Then the "if" is formmated correctly:

    if(Test(a) != 1)
    {
        status = ERROR;
    }

Please note that though this example is somewhat exotic, this is a minimization of a real-life case, which is affecting all formatting of our project.

Thanks!
 :-)


Reproducible: Always

Steps to Reproduce:
1. See exact senario above.
Comment 1 Anton Leherbauer CLA 2011-10-10 08:52:28 EDT
Fixed in cdt_8_0 and master.
Comment 2 CDT Genie CLA 2011-10-10 09:23:03 EDT
*** cdt git genie on behalf of Anton Leherbauer ***

    Bug 359658 - code formatter does not work as expected when complicate macro precedes formatted code

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=e7f50acc252c66de101203cf9b901c57ff52e736
Comment 3 CDT Genie CLA 2011-10-10 09:23:05 EDT
*** cdt git genie on behalf of Anton Leherbauer ***

    Bug 359658 - code formatter does not work as expected when complicate macro precedes formatted code

[*] http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=63cb434f4c810665682425085f04811a29154586