From 898f42e3a619461a69ca7f16eee3f985fa8287c1 Mon Sep 17 00:00:00 2001 From: Maxim Uvarov Date: Fri, 20 Feb 2015 21:20:10 +0300 Subject: linux-generic: pool set seg_len to 0 gcc 4.9 compiles current code fine, but gcc 4.7 fails with: odp_pool.c:293:20: error: 'seg_len' may be used uninitialized in this function Problem found with gcc 4.7 and make distcheck command which added additional flags for odp compilation. If newer gcc does not warn that variable can be used uninitialized (not for packet case in this function), it looks like compiler bug. Init it to 0 because pool creation is not performance function. Reviewed-by: Bill Fischofer Signed-off-by: Maxim Uvarov --- platform/linux-generic/odp_pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 8da3801b4..422ff2be7 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -136,7 +136,7 @@ odp_pool_t odp_pool_create(const char *name, ODP_CACHE_LINE_SIZE_ROUNDUP(init_params->udata_size) : 0; - uint32_t blk_size, buf_stride, buf_num, seg_len; + uint32_t blk_size, buf_stride, buf_num, seg_len = 0; uint32_t buf_align = params->type == ODP_POOL_BUFFER ? params->buf.align : 0; -- cgit v1.2.3