Hendrik Boom <hendrik@???> writes:
> On Mon, Aug 03, 2015 at 01:14:16PM +0100, Rainer Weikusat wrote:
>
>>
>> [*] In case you want an example where this is at least debatable (and I
>> happen to disgree with what he wrote on the topic). The simplest way
>> to implement a block memory copy in C is
>
> Correction:
>
>>
>> static void cpy(char *d, char const *s, size_t len)
>> {
>> while (len) --len, d[len] = s[len];
> while (len){ --len, d[len] = s[len]; |
>> }
>>
>
> It may have been simple, but not correct.
A C 'while loop' is defined as
while ( expression ) statement
and
--len, d[len] = s[len];
is a perfectly valid expression statement.