[dpdk-dev] [PATCH] net/mlx: fix variadic macro
Thomas Monjalon
thomas at monjalon.net
Thu Dec 12 23:24:21 CET 2019
11/12/2019 07:49, Ali Alnubani:
> This rewrites the MKSTR macro appending an empty string to its arguments
> to resolve build failures similar to:
>
> drivers/net/mlx4/mlx4.c:461:14: fatal error: format string is not a
> string literal [-Wformat-nonliteral]
> MKSTR(path, "%s/device/uevent", device->ibdev_path);
>
> drivers/net/mlx4/mlx4_utils.h:82:30: note: expanded from macro 'MKSTR'
> char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \
>
> drivers/net/mlx5/mlx5_stats.c:144:15: fatal error: format string is not a
> string literal [-Wformat-nonliteral]
> MKSTR(path, "%s/ports/%d/hw_counters/%s",
>
> drivers/net/mlx5/mlx5_utils.h:149:30: note: expanded from macro 'MKSTR'
> char name[snprintf(NULL, 0, __VA_ARGS__) + 1]; \
>
> The errors reproduce with clang version 9.0.0, and the release notes
> don't mention what could have caused them.
>
> Fixes: 7fae69eeff13 ("mlx4: new poll mode driver")
> Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
> Cc: adrien.mazarguil at 6wind.com
> Cc: stable at dpdk.org
>
> Signed-off-by: Ali Alnubani <alialnu at mellanox.com>
> Signed-off-by: Matan Azrad <matan at mellanox.com>
Applied quickly in main tree as it is fixing compilation with a recent clang 9.
More information about the dev
mailing list