From: Martin Costabel <costabel@wanadoo.fr>
To: Geoff Hutchison <ghutchis@wso.williams.edu>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: Possible gcc bug?
Date: Sun, 11 Jun 2000 13:00:01 +0200 [thread overview]
Message-ID: <39437131.F1DD3AE6@wanadoo.fr> (raw)
In-Reply-To: v04220801b568cc2210b4@[129.105.9.193]
Geoff Hutchison wrote:
> If I'm being a complete moron and doing something silly, please let
> me know and I'll eat my words.
I think you do: You are passing over the array bounds. If I remember my
C basics (which I never really learned either) correctly,
double field[loopX][loopY];
allows indices running from 0 to loopX-1 and from 0 to loopY-1.
In your first loop
/* Initialize arrays */
for (x = 0; x <= loopX; x++)
for (y = 0; y <= loopY; y++)
{
field[x][y] = 0.0;
points[maxX * x + y].ptX = x;
points[maxX * x + y].ptY = y;
}
you are clobbering random memory locations that may be different for
different compiler optimisation levels.
Replace "<=" by "<", and your errors will go away.
--
Martin
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2000-06-11 11:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-11 5:03 Possible gcc bug? Geoff Hutchison
2000-06-11 11:00 ` Martin Costabel [this message]
2000-06-11 14:08 ` Geoff Hutchison
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=39437131.F1DD3AE6@wanadoo.fr \
--to=costabel@wanadoo.fr \
--cc=ghutchis@wso.williams.edu \
--cc=linuxppc-dev@lists.linuxppc.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).