The __used__ and __section__ attribute for the batctl commands can be combined together to simplify the COMMAND_NAMED macro.
Signed-off-by: Sven Eckelmann sven@narfation.org --- main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/main.h b/main.h index d1bea23..00b2ab3 100644 --- a/main.h +++ b/main.h @@ -112,7 +112,7 @@ struct command { .usage = (_usage), \ }; \ static const struct command *__command_ ## _name ## _ ## _type \ - __attribute__((__used__)) __attribute__ ((__section__ ("__command"))) = &command_ ## _name ## _ ## _type + __attribute__((__used__,__section__ ("__command"))) = &command_ ## _name ## _ ## _type
#define COMMAND(_type, _handler, _abbr, _flags, _arg, _usage) \ COMMAND_NAMED(_type, _handler, _abbr, _handler, _flags, _arg, _usage)