• 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: C local auto-initialized?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C local auto-initialized?


  • Subject: Re: C local auto-initialized?
  • From: Chris Suter <email@hidden>
  • Date: Fri, 21 Sep 2007 09:11:52 +1000


On 21/09/2007, at 8:31 AM, Fritz Anderson wrote:


On Sep 20, 2007, at 5:14 PM, Greg Guerin wrote:

Jack Repenning wrote:

.... the Release disassembly might even show your uninitialized variables
have been optimized entirely into registers, with no in-memory presence at
all.

And possibly another bug to look for: garbage *register* values.

Remember my purpose — to teach by demonstrating a non-pristine value.

I don't object to a non-pristine value. I _want_ it.

And it's there; hurray! It loads into register $f0; hurray!

But the value disappears at the instant something is added to the register containing it. Why?

What exactly is the garbage value? If the exponent is large and negative you'll get the behaviour you're seeing.


Note that if you compile with all warnings enabled (which I do as a matter of course) and you have optimisations enabled, the compiler will warn you that you're using an uninitialised variable.

- Chris

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: C local auto-initialized?
      • From: Fritz Anderson <email@hidden>
References: 
 >Re: C local auto-initialized? (From: Greg Guerin <email@hidden>)
 >Re: C local auto-initialized? (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: Guard Malloc crashes...
  • Next by Date: Re: C local auto-initialized?
  • Previous by thread: Re: C local auto-initialized?
  • Next by thread: Re: C local auto-initialized?
  • Index(es):
    • Date
    • Thread