[PATCH] kernel: fix a compile error

OGAWA Hirofumi hirofumi at mail.parknet.co.jp
Wed May 8 02:32:19 PDT 2013


Liu Yuan <namei.unix at gmail.com> writes:

> From: Liu Yuan <tailai.ly at taobao.com>
>
> make -C /lib/modules/`uname -r`/build/ M=`pwd` CONFIG_TUX3=m modules
> make[1]: Entering directory `/home/yliu/linux-src'
>   CC [M]  /home/yliu/tux3/user/kernel/dir.o
> /home/yliu/tux3/user/kernel/dir.c: In function ‘tux_create_entry’:
> /home/yliu/tux3/user/kernel/dir.c:148:4: error: ‘rec_len’ undeclared (first use in this function)
> /home/yliu/tux3/user/kernel/dir.c:148:4: note: each undeclared identifier is reported only once for each function it appears in
> /home/yliu/tux3/user/kernel/dir.c:130:52: error: unused variable ‘orec_len’ [-Werror=unused-variable]
> cc1: all warnings being treated as errors
> ...

Hm. I'm not sure what this meant. 1st warning says about undeclared
variable. And 2nd one says about orec_len, but there is no orec_len in
the source.

> -	unsigned reclen = TUX_REC_LEN(len), rec_len, name_len, offset;
> +	unsigned reclen = TUX_REC_LEN(len), name_len = 0, rec_len, offset;

And this changes about name_len. BTW, what version of gcc is using?

Thanks.
-- 
OGAWA Hirofumi <hirofumi at mail.parknet.co.jp>



More information about the Tux3 mailing list