By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,851 Members | 2,097 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,851 IT Pros & Developers. It's quick & easy.

Bogus output on Wintel but good on SiliGee

P: n/a
I get bad results from a console-mode (no GUI), number-cruncher, C++
program when I run it on a Wintel box running Windows 2000 Pro, after
compiling it with Microsoft Visual C++. This very same code runs
correctly when run on a Silicon Graphics machine running IRIX 6.5,
after compiling it with the MIPSpro C++ compiler (CC).

The results on the Wintel machine are only a little off when running
in debug mode, but are total garbage when the release version is run.

Any ideas?
Jul 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Bill" <Bi***********@SYColeman.com> wrote...
I get bad results from a console-mode (no GUI), number-cruncher, C++
program when I run it on a Wintel box running Windows 2000 Pro, after
compiling it with Microsoft Visual C++. This very same code runs
correctly when run on a Silicon Graphics machine running IRIX 6.5,
after compiling it with the MIPSpro C++ compiler (CC).

The results on the Wintel machine are only a little off when running
in debug mode, but are total garbage when the release version is run.

Any ideas?


The difference between release and debug versions of your program
is most likely due to the fact that MS compiler initialises all
variables to something meaningful in debug and leaves uninitialised
objects as is in release. So, check your code to see if you rely
on some variable being 0 upon creation. For example

double a;

leaves 'a' uninitialised. In debug mode MSVC++ will make it 0. In
release mode you get garbage in it. If you create some kind of
accumulator

double integral;
for (blahblah)
integral += some_formula();

then, since 'integral' has never been initialised to 0, you add to
some random value.

Of course, it could be something else...

Victor
Jul 19 '05 #2

P: n/a
> Any ideas?

Consult a psychic. You will get some answers.

Without any _minimal_ code from you that illustrates the problem, what can
we tell?

Stephen Howe
Jul 19 '05 #3

P: n/a
On 8/8/03 3:37 PM, in article
53**************************@posting.google.com, "Bill"
<Bi***********@SYColeman.com> wrote:
I get bad results from a console-mode (no GUI), number-cruncher, C++
program when I run it on a Wintel box running Windows 2000 Pro, after
compiling it with Microsoft Visual C++. This very same code runs
correctly when run on a Silicon Graphics machine running IRIX 6.5,
after compiling it with the MIPSpro C++ compiler (CC).

The results on the Wintel machine are only a little off when running
in debug mode, but are total garbage when the release version is run.

Any ideas?


Is there a possibility that the program is reading binary data files and
that the endianism is different?

Jul 19 '05 #4

P: n/a
In article <BB****************@nottelling.com>, no**@nottelling.com
says...

[ ... ]
The results on the Wintel machine are only a little off when running
in debug mode, but are total garbage when the release version is run.

Any ideas?


Is there a possibility that the program is reading binary data files and
that the endianism is different?


Minimal -- if the problem was in the data file, chances are that there
would be little or no variation between debug and release modes on the
same machine.

--
Later,
Jerry.

The universe is a figment of its own imagination.
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.