[dpdk-dev] [PATCH] eal: fix compilation when optimization level is O1
Thomas Monjalon
thomas.monjalon at 6wind.com
Thu Oct 6 15:25:58 CEST 2016
2016-09-19 14:26, Olivier Matz:
> When compiled with EXTRA_CFLAGS="-O1", the compiler is not
> able to detect that size is always initialized when used, and
> issues a wrong warning:
>
> eal_memory.c: In function ‘rte_eal_hugepage_attach’:
> eal_memory.c:1684:3: error: ‘size’ may be used uninitialized in this
> function [-Werror=maybe-uninitialized]
> munmap(hp, size);
> ^
>
> Workaround this issue by initializing size to 0.
> Seen on gcc (Debian 5.4.1-1) 5.4.1 20160803.
>
> Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
Applied, thanks
More information about the dev
mailing list