Article View: comp.lang.c.moderated
Article #2323Re: use of the break statement
From: Andrew Dalgleish
Date: Mon, 18 Mar 1996 13:42
Date: Mon, 18 Mar 1996 13:42
29 lines
1251 bytes
1251 bytes
Marc Espie wrote:
> gcc is notorious for initalizing automatic local variables to 0 when
> not optimizing.
That sounds more like a (bad) design decision than a bug.
(Sorry about the C++)
In one snippet similar to
void A::func(int i)
{
m_pB = new B[i];
// Code which uses i
}
the MSC 7 optimizer introduced an extra local variable to hold "i", but
failed to initialize it with *anything*. The size of the allocated array
depended on whatever garbage was on the stack.
--
Andrew Dalgleish
Senior Software Engineer
Axon Research, Pty Ltd
6 Wallace Ave
Toorak, VIC
3142
AUSTRALIA
Tel: +61-3-9826-5538
Fax: +61-3-9824-0083
Technical Details
Message-ID:
<4ijp7e$1ae@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<4gfcl7$2ls@solutions.solon.com> <4h81gh$aql@solutions.solon.com> <4h9ml2$gub@solutions.solon.com> <4i97m5$8j0@solutions.solon.com> <4ianao$h7f@solutions.solon.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail From: Andrew Dalgleish <andrewd@axonet.com.au> Newsgroups: comp.lang.c.moderated Subject: Re: use of the break statement Date: 18 Mar 1996 07:42:06 -0600 Organization: Axon Research, Pty Ltd Sender: clc@solutions.solon.com Approved: clc@solutions.solon.com Message-ID: <4ijp7e$1ae@solutions.solon.com> References: <4gfcl7$2ls@solutions.solon.com> <4h81gh$aql@solutions.solon.com> <4h9ml2$gub@solutions.solon.com> <4i97m5$8j0@solutions.solon.com> <4ianao$h7f@solutions.solon.com> NNTP-Posting-Host: solutions.solon.com X-Mailer: Mozilla 2.0 (Win95; I)