[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
indent 2.2.10 -bap broken
From: |
M. Allison |
Subject: |
indent 2.2.10 -bap broken |
Date: |
Tue, 09 Dec 2014 23:08:19 -0500 |
User-agent: |
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 |
2.2.10 has a broken -bad or –blank-lines-after-declarations
In 2.2.10 -bad puts a blank line after every individual declaration
statement instead of at the end of the last one as prior versions did.
This update is apparently the cause:
* - 28 Sep 2003 Erik de Castro Lopo
* Fixed Bug#212320: --blank-lines-after-procedures does not work
The code block that was completed disabled in indent.c by "#if 0" should
be re-enabled,
then the attached patch applied to allow both -bad and -bap to work.
Test case:
------------------------
int test()
{
int i;
char *p;
i = rnd(10);
for (k=1; k < 10; ++k) {
int j=2;
int l=1;
j=i+j;
j=j+l;
}
}
int func1 (void)
{
return 42;
}
static int func2 (void)
{
return 43 ;
}
------------------------
Results with indent 2.2.10 -bad -bap:
int
test ()
{
int i;
char *p;
i = rnd (10);
for (k = 1; k < 10; ++k)
{
int j = 2;
int l = 1;
j = i + j;
j = j + l;
}
}
int
func1 (void)
{
return 42;
}
static int
func2 (void)
{
return 43;
}
------------------------
Results after attached patch with indent 2.2.10 -bad -bap:
int
test ()
{
int i;
char *p;
i = rnd (10);
for (k = 1; k < 10; ++k)
{
int j = 2;
int l = 1;
j = i + j;
j = j + l;
}
}
int
func1 (void)
{
return 42;
}
static int
func2 (void)
{
return 43;
}
fix-indent2.2.10.diff
Description: Text document
- indent 2.2.10 -bap broken,
M. Allison <=