[dpdk-dev] [PATCH] net/mlx5: fix compilation issue with gcc pragma

Stephen Hemminger stephen at networkplumber.org
Tue Oct 1 16:54:29 CEST 2019


On Tue,  1 Oct 2019 11:10:23 +0000
Viacheslav Ovsiienko <viacheslavo at mellanox.com> wrote:

> +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 40600)
> +#pragma GCC diagnostic push
>  #pragma GCC diagnostic ignored "-Wformat-nonliteral"
> +#endif
> +	/* Use safe format to check maximal buffer length. */
>  	while (fscanf(file, format, ifname) == 1) {
> -#pragma GCC diagnostic error "-Wformat-nonliteral"
> +#if defined(RTE_TOOLCHAIN_GCC) && (GCC_VERSION >= 40600)
> +#pragma GCC diagnostic pop
> +#endif

This is messy, is there not a better way to do this?


More information about the dev mailing list