• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: GCC 4.0 "C" question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GCC 4.0 "C" question


  • Subject: Re: GCC 4.0 "C" question
  • From: David Fang <email@hidden>
  • Date: Mon, 31 Oct 2005 16:33:51 -0500 (EST)

> I'm taking on some older code, and I'm getting this warning: "warning:
> target of assignment not really an lvalue; this will be a hard error
> in the future"
>
> for the following line:
>
> *((uint32_t*)dst)++ = *((uint32_t*)src)++;
>
> Why is this code going to be an error in the future?

Hi,
	it seems such casting was deprecated since gcc-3.4, according to:
http://gcc.gnu.org/gcc-3.4/changes.html.  (search for cast-as-lvalue, in
the C/C++ section.)  This also applies to 4.0, of course.  This was a
GNU-extension, not part of the C standard, so the best bet is to not
depend on it, for portability.  To see why lvalue-casts are a bad idea,
check the following thread:
http://gcc.gnu.org/ml/gcc/2003-05/msg00847.html

David Fang

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >GCC 4.0 "C" question (From: Mark Dawson <email@hidden>)

  • Prev by Date: Dylan 'compiler' support
  • Next by Date: Re: GCC 4.0 "C" question
  • Previous by thread: GCC 4.0 "C" question
  • Next by thread: Re: GCC 4.0 "C" question
  • Index(es):
    • Date
    • Thread