[PATCH 2/3] sha1: silence warning on big endian platforms

Denys Vlasenko vda.linux at googlemail.com
Sat Nov 7 00:28:20 UTC 2009


On Friday 06 November 2009 10:56, Marc Kleine-Budde wrote:
> Silence this warning, which crashes when CONFIG_WERROR is active:
> 
> cc1: warnings being treated as errors
> libbb/sha1.c: In function 'sha1_end':
> libbb/sha1.c:411: error: unused variable 'i'
> libbb/sha1.c: In function 'sha512_end':
> libbb/sha1.c:446: error: unused variable 'i'
> 
> Signed-off-by: Marc Kleine-Budde <mkl at pengutronix.de>
> ---
>  libbb/sha1.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/libbb/sha1.c b/libbb/sha1.c
> index ea645b7..964ff3c 100644
> --- a/libbb/sha1.c
> +++ b/libbb/sha1.c
> @@ -410,6 +410,8 @@ void FAST_FUNC sha1_end(void *resbuf, sha1_ctx_t *ctx)
>  {
>  	unsigned i, pad, in_buf;
>  
> +	(void)i;
> +

Ugly. Cleaner way is to move declaration of i where it is used.

--
vda


More information about the busybox mailing list