[Top][All Lists]

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

Re: [avr-gcc-list] Deprecated warning on 3.4.1

From: David Gay
Subject: Re: [avr-gcc-list] Deprecated warning on 3.4.1
Date: Wed, 04 Aug 2004 10:20:22 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124

Harald Kipp wrote:

  *dst++ = *((unsigned char *) src)++;

the compiler 3.4.1 (WinAVR) mumbles

  warning: use of cast expressions as lvalues is deprecated

But there is no casted lvalue. Looks like he doesn't like

  ((cast_t *)var)++

Am I doing something nasty here?

++ binds tighter than *, so you've done:

  dereference the incremented cast of src to unsigned char *

(and so you are indeed using the result of a cast as an lvalue)

You presumably wanted

  (*((unsigned char *)src))++

which is

  increment the dereference of the cast of src to unsigned char *

David Gay

reply via email to

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