[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: error: md5.c invalid use of void expression
From: |
Bruce Korb |
Subject: |
Re: error: md5.c invalid use of void expression |
Date: |
Fri, 04 Jan 2013 15:27:23 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 |
On 01/04/13 15:21, Bruce Korb wrote:
> On 01/04/13 12:47, Paul Eggert wrote:
>> On 01/03/2013 08:30 AM, Petr Písař wrote:
>>> 4.13.1 release replaced SWAP() macro with function.
>>
>> The 4.13.1 release shipped with an obsolete version of md5.c and md5.h,
>> which (as you saw) has some problems. I suggest upgrading to
>> the latest versions of these two files, which you can get here:
>>
>> http://git.savannah.gnu.org/cgit/gnulib.git/plain/lib/md5.c
>>
>> http://git.savannah.gnu.org/cgit/gnulib.git/plain/lib/md5.h
>
> As given to me, sharutils included the md5 source.
> Since I've gnulib-ified the thing, I'm adding crypto/md5 to the
> list of modules I pull. That ought to take care of it... :) Thanks.
>
In file included from shar.c:55:0:
../lib/md5.c: In function 'md5_process_bytes':
../lib/md5.c:261:13: error: invalid use of void expression
256 #if !_STRING_ARCH_unaligned
257 # define UNALIGNED_P(p) ((uintptr_t) (p) % alignof (uint32_t) != 0)
258 if (UNALIGNED_P (buffer))
259 while (len > 64)
260 {
261 md5_process_block (memcpy (ctx->buffer, buffer, 64), 64,
ctx);
262 buffer = (const char *) buffer + 64;
263 len -= 64;
264 }
265 else
266 #endif
This fixes it:
261 memcpy (ctx->buffer, buffer, 64);
262 md5_process_block (ctx->buffer, 64, ctx);
There's no particular reason for having a nested call there anyway.