bugGNU indent - Bugs: bug #41966, -ce option moves comment after if{}

 
 

bug #41966: -ce option moves comment after if{}

Submitted by:  Daniel P. Valentine <dpv>
Submitted on:  Wed 26 Mar 2014 10:05:56 PM UTC  
 
Category:  C Severity:  3 - Normal
Item Group:  Inconsistency Status:  Fixed
Privacy:  Public Assigned to:  Daniel P. Valentine <dpv>
Open/Closed:  Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 28 Mar 2014 11:30:39 PM UTC, comment #1:

Corrected this and a couple of related inconsistencies. It is in the code repository (with new regression tests) and should be included in the next release.

Daniel P. Valentine <dpv>
Project AdministratorIn charge of this item.
Wed 26 Mar 2014 10:05:56 PM UTC, original submission:

the -ce causes comment following closing if brace to move to next line
From: Phil Smith
Subject: the -ce causes comment following closing if brace to move to next line
Date: Fri, 9 Aug 2013 19:50:49 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

With this example:

int aa(int b)
{
int a = 1;;
if (a == 1) {
a = 2;
} /* if (a == 1 ... */
/* call check a */
if (!check(a)) {
a = 0;
}
}

Running this command:

/bin/indent -br -ce -st aa.c

The output is this:

int
aa (int b)
{
int a = 1;;
if (a == 1) {
a = 2;
}
/* if (a == 1 ... */
/* call check a */
if (!check (a)) {
a = 0;
}
}

However I wouldn't expect the -ce to cause the
/* if (a == 1 ... */
comment to move onto the next line.
Without the -ce this doesn't happen.

Daniel P. Valentine <dpv>
Project AdministratorIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dpv (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-03-28 dpv StatusNone => Fixed
        Assigned toNone => dpv
    2014-03-27 dpv CategoryNone => C
    2014-03-27 dpv Item GroupNone => Inconsistency

    Back to the top


    Powered by Savane 3.3