<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61585>61585</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
formating breaks in array without trailing comma
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
fneddy
</td>
</tr>
</table>
<pre>
i have a very strange behavior with my current .clang-format file.
here is the file:
```
---
BasedOnStyle: LLVM
ColumnLimit: 200
IndentWidth: 4
UseTab: Always
TabWidth: 4
BreakBeforeBraces: Linux
```
considering this example C code it will format it as expected:
```
struct foo {
char a;
int b;
};
static const struct foo data[] = {
{'a', 1},
{'b', 2},
{'c', 3},
};
```
however if i remove the trailing `,` the formatting will not break the lines any more
```
struct foo {
char a;
int b;
};
static const struct foo data[] = {{'a', 1}, {'b', 2}, {'c', 3}};
```
it seems that this is a bug due to a missing `,` after the last array element. however this is `C` and not json so there shouldn't be a trailing `,` . e.g. C std pdf N2310 ยง 6.7.9 make all examples of initializer lists without trailing commas
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVMGO4zYM_RrlQsRw5MSZHHyYZDBAgWl76LY90xIdc1eWAolONv36Qnamk1mk6LVA4Eh81CP1SBFT4qMnatRmrzYvCxylD7HpPFl7XbTBXhtVvqjyef4y9HgmQDhTvEKSiP5I0FKPZw4RLiw9DFcwY4zkBQrj0B-XXYgDCnTsqLhn6ykScALpaQJVdQNUXd5-03a5XM6LPSayv_rf5Do5w9vbHz_PyCG4cfBvPLBkQJe3oz95S17-ZCt9tq9n6--JvmCbDc_ugtc0W79g-6PjPhJ-21MXIu0jGkpTVPbj94eJzl8TfGJLkf0RpOcE9B2HkyM4gAmWgAUu7BzcZGEBzD4nMkL23zRIEkcj0IUAarufbQAApscIqKo7E3uB9h-L2r58rG9UKGwgpylwx2tRcG4DUNXL5zB5o7eo9FbpA6wyqT78CLc3WD-GzQ2u7uFP6T1Ssw8XOlME7oAh0hDONDWMRGSXJc7--qDqcu6jSVTJwCSyDwJtruKEOvaUAP0VhhDpPsz_Qu5HIj_W9pGk_6UkCySiIb83lLkzOQFCOx7BjgQSAGHglD6rip1QnNXDJIAx4hXI0UBeCoD3-rzzqbqcj3k7if81BQ8pZIJIkPowOuuV3gq0eZA8KGMBVBwLOEASCyfbwS-6WpWgDlo9b6EutsUOBvxGgM69v60EoQP2LIyO_6IIjpOkaSCFUT6imDAMmGAWZGGbyu6qHS6oWdXb3Xq12lX1om-6Xb1dt6YsWyrruu3WaExHbVmap53Vul1wo0tdlZVerTarp01dmI3R1NJO44a6sq7UuqQB2RXOnYcixOOCUxqpqVebp83CYUsuTTNXa08XmECldR7Bsclnlu14TGpdTvf4YBEWR83c5Pk-U2snYH-ry-MLL8boml7klOeX0q9Kvx5Z-rEtTBiUfs30t7_lKYavZETp1ymppPTrlPTfAQAA__-68s7S">