Issues with uncrustify

Bug #1252490 reported by Pupu Toivonen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HIPL
New
Undecided
Pupu Toivonen

Bug Description

The Uncrustify Code Beautifier tool systematically aligns variable names, although it might not be reasonable in all places.

 struct sockaddr_in6 hipfw_addr;
-int n = 0;
+int n = 0;

There is the variable align_var_def_thres in Uncrustify config file, which can be used to set an upper bound for how many spaces can be used for aligning.

I found no configuration item in Uncrustify for forcing spaces between struct name and "{":

i.e. to catch:
typedef struct NetlinkList{

and turn it into:
typedef struct NetlinkList {

Also there is a known bug in Uncrustify (http://sourceforge.net/p/uncrustify/bugs/522/) that causes it to mistake a special case of variable definitions (a static pointer to an array of function pointers) for a function call, and apply rules related to function calls instead of rules related to variable definitions.

-static int (*action_handler[])(struct hip_common *, int action,
+static int(*action_handler[]) (struct hip_common *, int action,
                                const char *opt[], int optc, int send_only) = {

Pupu Toivonen (scolphoy)
description: updated
description: updated
Pupu Toivonen (scolphoy)
summary: - Alignment issues with uncrustify
+ Issues with uncrustify
description: updated
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.