bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error: md5.c invalid use of void expression


From: Eric Blake
Subject: Re: error: md5.c invalid use of void expression
Date: Fri, 04 Jan 2013 16:56:48 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

On 01/04/2013 04:27 PM, Bruce Korb wrote:

> 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

What platform and compiler produced this message?  Do you have a bug
where your platform's memcpy() returns 'void' instead of the required
'void *'?

>     261             md5_process_block (memcpy (ctx->buffer, buffer, 64), 64, 
> ctx);

> This fixes it:
> 
>     261             memcpy (ctx->buffer, buffer, 64);
>     262             md5_process_block (ctx->buffer, 64, ctx);

While that is indeed safe, I'm still trying to figure out why we'd need it.

> 
> There's no particular reason for having a nested call there anyway.

But there's also no particular reason why we should avoid it, unless we
know more about which environment is broken if we don't avoid it, since
as written, it is standards-compliant code.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]