• 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: Bug in g++'s int constructor?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in g++'s int constructor?


  • Subject: Re: Bug in g++'s int constructor?
  • From: Dennis De Mars <email@hidden>
  • Date: Thu, 28 Mar 2002 19:03:52 -0800

On Thursday, March 28, 2002, at 05:06 PM, Mark wrote:

Well that's what I had to do get the program running so I could pass it in. It just made tracking down the problem with my CS prof. frustrating for us both, since we both made assumptions that this was implemented correctly. It isn't a major flaw, but it should still be fixed. I was just curious as to if anyone has filled a bug report about this...

Am I off base on this? As far as I'm concerned compiler consistency is a good thing. Especially if Apple wants Unix source to be ported over to OS X without causing too high of an aggravation factor, where these types of assumptions may be made ( as far as I know our digital unix server we use for compiling at school has no trouble with this ).

As has been pointed out in other replies, ints don't have "constructors" and they are not guaranteed to be initialized to any particular value unless you explicitly initialize it. This is equally true in C and in C++. The fact that it happened to work the way you expected with another compiler is a matter of chance, the code is incorrect as written.

The only reason I am responding is just to express amazement that your CS prof seems to be under the same misconception as you about how this is supposed to work!

- Dennis D.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Bug in g++'s int constructor?
      • From: "Clark S. Cox III" <email@hidden>
References: 
 >Re: Bug in g++'s int constructor? (From: Mark <email@hidden>)

  • Prev by Date: NSString Unicode canonical decompositions?
  • Next by Date: App dying under MallocDebug and ObjectAlloc
  • Previous by thread: Re: Bug in g++'s int constructor?
  • Next by thread: Re: Bug in g++'s int constructor?
  • Index(es):
    • Date
    • Thread