Skip to content

Get sp_inside_braces_struct working #1240

@mihaipopescu

Description

@mihaipopescu

Can't set sp_inside_braces_struct=add otherwise Uncrustify starts applying it to initializers combined with old-C-style struct usage.

struct in_addr addr = {0};
... --> ...
struct in_addr addr = { 0 };

Expected versus output diff:

diff --git "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\10060-UNI-1350.cpp" "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\10060-UNI-1350.cpp"
index 8fc358d..e3a60f5 100644
--- "a/C:\\work\\external\\uncrustify\\tests\\output\\staging\\10060-UNI-1350.cpp"
+++ "b/C:\\work\\external\\uncrustify\\tests\\results\\staging\\10060-UNI-1350.cpp"
@@ -1,5 +1,5 @@
 // Can't set sp_inside_braces_struct=add otherwise Uncrustify starts applying it to initializers combined with old-C-style struct usage.
 
-struct in_addr addr = {0};
+struct in_addr addr = { 0 };
 // ... --> ...
 struct in_addr addr = { 0 };

Debug support files:

10060-UNI-1350.cpp
10060-UNI-1350.cpp.log
10060-UNI-1350.cpp.unc
UNI-1350.cfg
UNI-1350.cpp

Disclaimer:

Note: This is a generated issue from our internal issue tracker.
Expect a dry description which could be insufficient to properly understand the issue.
On the other hand, the support files should be sufficient to easily reproduce and debug the issue,
but please comment if it's still unclear and I will get back with clarifications.
See main discussion thread here #1223.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions