Open kudaravalli opened 7 years ago
Yes I can confirm both the problem and the hash. Uncrustify keeps looping endlessly in reindent_line() at indent.cpp:315
Related to #1293 The problem is having a struct initializer inside a struct initializer inside something. uncrustify can't yet deal with that. The output are not predictable.
Update: uncrustify 0.76.0 still seems to freeze, but in fact creates billions of whitespace characters.
Given this code (as .c file):
void A()
{
static char ixy[3][33] = {
{ 5, 0, 0, 35, 100, 70, 0, 56, 40, 14, 40 },
{ 12, 0, 0, 0, 100, 55, 100, 65, 90, 65, 65, 55, 55, 0, 55, 60, 55, 70, 45, 70, 10, 60, 0, 0, 0 },
{ 16, 60, 55, 70, 45, 70, 10, 60, 0, 10, 0, 0, 10, 0, 45, 10, 55, 60, 55, 70, 65, 70, 90, 60, 100, 10, 100, 0, 90,
0, 65, 10, 55 },
};
}
with the simple configuration
align_struct_init_span=1
code_width=120
results in a negative value for the "Columns Br" value (see attached dumpstep file), which is then interpreted as a huge (64bit) positive value.
Note: To reproduce, you'll have to kill the process quickly, before the last line in the dumpstep file gets too long ;-)
Hi, There seems to be a regression with formatting large multi-dimensional arrays with release version 0.66 or specifically with this recent commit below. The tool appears to hang for a long time consistently (at least on a Windows system but does slightly better on a Linux system). We didn't see this issue with release 0.65.
commit 81ce3ff37dca0ef7d4d637ace444a3782a9673bc
Input source:
Uncrustify config file