On Mon, 11 May 1998, David Spencer wrote:

> > Yes, the code was buggy of course, it's a small wonder that the
> > non-optimized binary didn't coredump as well, because I was writing
> > beyond the end of a string... Thanks for the explanation anyway! I've
> > never programmed any assembler, so I really have no idea what
> > optimizations do to the code. I imagined it was just a magical way of
> > making it run faster, but now I know better.
> 
> Let me guess - was one of your optimisations a space optimisation? 
> Memory allocation doesn't normally allocate exactly what you asked for;
> it will allocate up to the next 16, or 32, or some other number, bytes. 
> So unoptimised char x[12]; x[13]=0 may work, because you've actually got
> 16, but if you optimise this you will only have 12 and therefore a
> crash.

I seem to be learning things all the time! Not strange, since I
haven't done any reading on the subject... Thanks for enlightening
me! I just used -O2, don't know at all what kind of optimization that
does, but I'm sure you know.

> Why aren't you using C++ and smart strings?

Because I haven't had time to learn C++ yet.

Linus

-------------------------------------------
Linus Åkerlund    e-mail: [EMAIL PROTECTED]
http://hem2.passagen.se/c64linus/index.html
http://members.xoom.com/vic20/index.html
http://user.tninet.se/~uxm165t/index.htm
-------------------------------------------


--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com/RedHat-FAQ /RedHat-Errata /RedHat-Tips /mailing-lists
         To unsubscribe: mail [EMAIL PROTECTED] with
                       "unsubscribe" as the Subject.

Reply via email to