Re: memory allocation problems




"Simon Trew" <ten.enagro@werts> wrote in message
news:OgcRzDjZFHA.2796@xxxxxxxxxxxxxxxxxxxxxxx

>> (I take it you *are* remembering the [] in the delete statement?)
>
> On VC6 and 7.0 implementations (haven't tried it on 7.1 or 8b2),
> it magically works anyway. It's undefined behavior, of course, but
> it's unlikely to cause this particular bug.

Interesting. I didn't know that.

I'll now try to forget I do and go on writing correct code :-)

Dave
--
David Webber
Author MOZART the music processor for Windows -
http://www.mozart.co.uk
For discussion/support see
http://www.mozart.co.uk/mzusers/mailinglist.htm


.



Relevant Pages

  • Re: worst.c - foolishness
    ... My change merely replaces "undefined behavior upon calling ... > my bug is much subtler. ... > will store a number in 'foo', and then, assuming the user has pressed ... I don't like the doublecheck for eof though. ...
    (comp.lang.c)
  • Re: Buffer overflows and asctime()
    ... legalese tend to get lost in their word mazes and loose ... the technical knowledge that should be the basis of ... what is a BUG and how to fix it. ... This call to strcpyinvokes undefined behavior. ...
    (comp.std.c)
  • Re: lcc-win32
    ... > timeptr produce undefined behavior in the sample algorithm (for ... > I think that this was the wrong answer to give to a bug report. ... If you wish you can write a supervisory function to do the error ...
    (comp.lang.c)
  • Re: worst.c - foolishness
    ... Note the subtle change ... it's one bug less if you ignore the misdefinition.. ... elsewhere) with "undefined behavior upon passing NULL to feof". ... will store a number in 'foo', and then, assuming the user has pressed ...
    (comp.lang.c)
  • [patch 2/2] x86 amd fix cmpxchg read acquire barrier
    ... There is no official AMD bug ID yet, but it seems to be reported in the field ... unsigned long prev; ... switch { ... LOCK_PREFIX " cmpxchgl %2,%0\n\t" ...
    (Linux-Kernel)