[dpdk-dev] [RFC PATCH 1/5] graph: introduce graph subsystem

Stephen Hemminger stephen at networkplumber.org
Sun Feb 2 11:38:17 CET 2020


On Fri, 31 Jan 2020 22:31:57 +0530
<jerinj at marvell.com> wrote:

> +
> +#define set_err(err, where, fmt, ...) do {				       \
> +	graph_err(fmt, ##__VA_ARGS__);					       \
> +	rte_errno = err;						       \
> +	goto where;							       \
> +} while (0)

I dislike this macro, it makes static analysis harder and requires
the reader to know that the argument is a goto target. And since it is lower
case, implies that it is a function. Usually macros are in upper case.

It makes the code smaller but a cost of being different which impacts the
readability of the code.


More information about the dev mailing list