[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-indent] indent-2.2.8: parsing bug
From: |
Nelson H. F. Beebe |
Subject: |
[Bug-indent] indent-2.2.8: parsing bug |
Date: |
Thu, 12 Dec 2002 10:04:19 -0700 (MST) |
In indent-2.2.8 (and the earlier 2.2.6 and 2.2.7 releases) on several
platforms, this simple test file (reduced from a much larger program)
uncovers an indent parsing bug:
% cat bug.c
#define FP(x) x
void
foo(void)
{
double dmax;
if (3 < 10)
dmax = (double)3 * FP(10.0);
else if (3 < 30)
dmax = (double)3 * FP(5.0);
}
Here is what happens:
% indent < bug.c
#define FP(x) x
void
foo(void)
{
double dmax;
if (3 < 10)
dmax = (double)3 *FP(10.0);
indent: Standard input:10: Error:Unmatched 'else'
else
if (3 < 30)
dmax = (double)3 *FP(5.0);
}
If I change FP(10.0) to 10.0 in line 10, the error message does not
appear, and the output is correct.
-------------------------------------------------------------------------------
- Nelson H. F. Beebe Tel: +1 801 581 5254 -
- Center for Scientific Computing FAX: +1 801 581 4148 -
- University of Utah Internet e-mail: address@hidden -
- Department of Mathematics, 110 LCB address@hidden address@hidden -
- 155 S 1400 E RM 233 address@hidden -
- Salt Lake City, UT 84112-0090, USA URL: http://www.math.utah.edu/~beebe -
-------------------------------------------------------------------------------
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug-indent] indent-2.2.8: parsing bug,
Nelson H. F. Beebe <=