Skip to content

Commit b4c42bc

Browse files
committed
Remove semicolons from macro expansions
This is almost never what's wanted since the user of the macro will naturally add the semicolon: > src/pool/pool_disjoint.c:55:69: warning: > ISO C does not allow extra ‘;’ outside of a function [-Wpedantic] > static const struct ctl_argument CTL_ARG(name) = CTL_ARG_STRING(255);
1 parent 57d930a commit b4c42bc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/ctl/ctl_internal.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,15 @@ void ctl_register_module_node(struct ctl *c, const char *name,
127127

128128
int ctl_arg_boolean(const void *arg, void *dest, size_t dest_size);
129129
#define CTL_ARG_BOOLEAN \
130-
{sizeof(int), {{0, sizeof(int), ctl_arg_boolean}, CTL_ARG_PARSER_END}};
130+
{ \
131+
sizeof(int), { {0, sizeof(int), ctl_arg_boolean}, CTL_ARG_PARSER_END } \
132+
}
131133

132134
int ctl_arg_integer(const void *arg, void *dest, size_t dest_size);
133135
#define CTL_ARG_INT \
134-
{sizeof(int), {{0, sizeof(int), ctl_arg_integer}, CTL_ARG_PARSER_END}};
136+
{ \
137+
sizeof(int), { {0, sizeof(int), ctl_arg_integer}, CTL_ARG_PARSER_END } \
138+
}
135139

136140
#define CTL_ARG_LONG_LONG \
137141
{ \
@@ -142,7 +146,9 @@ int ctl_arg_integer(const void *arg, void *dest, size_t dest_size);
142146

143147
int ctl_arg_string(const void *arg, void *dest, size_t dest_size);
144148
#define CTL_ARG_STRING(len) \
145-
{len, {{0, len, ctl_arg_string}, CTL_ARG_PARSER_END}};
149+
{ \
150+
len, { {0, len, ctl_arg_string}, CTL_ARG_PARSER_END } \
151+
}
146152

147153
#define CTL_STR(name) #name
148154

0 commit comments

Comments
 (0)