• 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: Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function )
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function )


  • Subject: Re: Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function )
  • From: Eric Gorr <email@hidden>
  • Date: Fri, 9 Jul 2010 18:21:20 -0400

Ok. So, it seems clang should probably emit a warning about this.

Sent from my iPad

On Jul 9, 2010, at 6:05 PM, Mark Wagner <email@hidden> wrote:

> On Fri, Jul 9, 2010 at 14:35, Eric Gorr <email@hidden> wrote:
>
>> If it is undefined behavior, then it still seems like a bug in the compiler
>> in that a warning or error should be emitted for this odd line of code.
>> In any case, writing this line of code was clearly an error in the real
>> application and simply getting rid of it fixed the problem I was having.
>> Still....would like to have a better understanding of what the actual
>> problem is.... (undefined behavior or just a bug in the compilers)
>> Any thoughts?
>
> It is undefined behavior (you're accessing the value of the variable
> "kMinimumWidth" before setting it), and since it's undefined, the C
> standard permits the compiler to do whatever it wants to (up to and
> including making demons fly out of your nose).
>
> --
> Mark
 _______________________________________________
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: Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function )
      • From: Jocelyn Houle <email@hidden>
References: 
 >Controlling optimization level per function (From: Eric Gorr <email@hidden>)
 >Re: Controlling optimization level per function (From: "Sean McBride" <email@hidden>)
 >Re: Controlling optimization level per function (From: Eric Gorr <email@hidden>)
 >Re: Controlling optimization level per function (From: "Sean McBride" <email@hidden>)
 >Re: Controlling optimization level per function (From: Eric Gorr <email@hidden>)
 >Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function ) (From: Eric Gorr <email@hidden>)
 >Re: Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function ) (From: Mark Wagner <email@hidden>)

  • Prev by Date: Re: Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function )
  • Next by Date: Make the app quietly go away.
  • Previous by thread: Re: Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function )
  • Next by thread: Re: Compiler Weirdness and possible bug ( was Re: Controlling optimization level per function )
  • Index(es):
    • Date
    • Thread