Whamcloud - gitweb
LU-1821 build: fix build error about VLA at file scope
authorPeng Tao <tao.peng@emc.com>
Tue, 28 Aug 2012 17:44:37 +0000 (01:44 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 10 Sep 2012 15:33:08 +0000 (11:33 -0400)
commitc35f6d4028d49e668c1cdd37b7f51e7c0a814b4c
treebda36850f861f05e9de2d451da1a2cba1d2b3655
parentbd12686ac514c0379eaf2834544b7562739f11f2
LU-1821 build: fix build error about VLA at file scope

Fix build error:
drivers/incore/fs_incore.c:340:54: error: variably modified
‘incore_dir_template’ at file scope [-Werror]

C99 does not allow VLA at file scope. Allocate incore_dir_template
dynamically to avoid build error with newer gcc(>4.6.3) that checks
this.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Icc81c649f58772e76e1cd3dcd42348a53a9a942b
Reviewed-on: http://review.whamcloud.com/3856
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libsysio/drivers/incore/fs_incore.c
libsysio/include/fs.h
libsysio/src/init.c