473,407 Members | 2,676 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Help! Wrong results in the release version!

Hi,

I wrote a C++ program(Using VC 6.0). It's run well under debug
environment.
After i finished it and made a release version. The different results
are outputed.
Anybody have this experience? I guess that's because the optimized
compiling in the release version. How can i do?????? :-(
Really thanks for your help.

Arber
Jul 22 '05 #1
5 1344
"arber" <yx*@sfu.ca> wrote in message
news:74**************************@posting.google.c om...
Hi,

I wrote a C++ program(Using VC 6.0). It's run well under debug
environment.
After i finished it and made a release version. The different results
are outputed.
Anybody have this experience? I guess that's because the optimized
compiling in the release version. How can i do?????? :-(
Really thanks for your help.

Arber

Hello,

This is a compiler specific question and not much appropriate in this
newsgroup.
However, I recall there was an article named "Release vs Debug build", you
can search google for it.

--
Elias
Jul 22 '05 #2
On Tue, 30 Dec 2003 03:21:05 -0800, arber wrote:
Hi,

I wrote a C++ program(Using VC 6.0). It's run well under debug
environment.
After i finished it and made a release version. The different results
are outputed.
Anybody have this experience? I guess that's because the optimized
compiling in the release version. How can i do?????? :-(
Really thanks for your help.


As one tip, look for asserts with side effects.

HTH,
M4

Jul 22 '05 #3
"Martijn Lievaart" <m@remove.this.part.rtij.nl> wrote...
On Tue, 30 Dec 2003 03:21:05 -0800, arber wrote:
Hi,

I wrote a C++ program(Using VC 6.0). It's run well under debug
environment.
After i finished it and made a release version. The different results
are outputed.
Anybody have this experience? I guess that's because the optimized
compiling in the release version. How can i do?????? :-(
Really thanks for your help.


As one tip, look for asserts with side effects.


'nother tip: some compilers zero-initialise all variables in Debug
but not in Release. Initialise the necessary variables yourself.
Jul 22 '05 #4
This link might be of help for a start

http://users.stargate.net/~newcomer/debug_release.htm
Jul 22 '05 #5
On Tue, 30 Dec 2003 15:40:40 GMT, "Victor Bazarov"
<v.********@comAcast.net> wrote:
"Martijn Lievaart" <m@remove.this.part.rtij.nl> wrote...
On Tue, 30 Dec 2003 03:21:05 -0800, arber wrote:
> Hi,
>
> I wrote a C++ program(Using VC 6.0). It's run well under debug
> environment.
> After i finished it and made a release version. The different results
> are outputed.
> Anybody have this experience? I guess that's because the optimized
> compiling in the release version. How can i do?????? :-(
> Really thanks for your help.


As one tip, look for asserts with side effects.


'nother tip: some compilers zero-initialise all variables in Debug
but not in Release. Initialise the necessary variables yourself.


Martijn and Victor's suggestions are good ones.

In my own experience, such differences have often resulted from
overrunning array boundaries. In debug mode, there are several "buffer"
bytes tacked on to the end of any memory block, which you can write to
and read from without breaking anything else (such as the variable
defined just before or just after the block in question). In release
mode, of course, these buffers vanish, and what was formerly an
innocuous bug becomes catastrophic. Debugging environments should let
you know when you have written into these buffers (although my
experience has been that they don't always), but they surely can't tell
if you are reading from them.

One other point of note. I recently worked on a project which involved
heavy amounts of floating point calculations. Running the same data
through the debug and release versions often gave results that varied by
1% or more. I stepped through the code in both situations (it's
possible, though not always good for your sanity, to enable debugging of
release builds) and saw that multiplying the same numbers did not give
the same results. Setting the "improved floating point consistency"
option (in MSVC7.1, don't know what other compilers might have such a
setting) brought them much closer together with no noticeable change in
speed.

--
Greg Schmidt (gr***@trawna.com)
Trawna Publications (http://www.trawna.com/)
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tom | last post by:
A question for gui application programmers. . . I 've got some GUI programs, written in Python/wxPython, and I've got a help button and a help menu item. Also, I've got a compiled file made with...
4
by: Sarir Khamsi | last post by:
Is there a way to get help the way you get it from the Python interpreter (eg, 'help(dir)' gives help on the 'dir' command) in the module cmd.Cmd? I know how to add commands and help text to...
2
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
0
by: tbatwork828 | last post by:
If you were like me trying to figure out how to launch context sensitive help topic by the context id, here is the link: http://weblogs.asp.net/kencox/archive/2004/09/12/228349.aspx and if...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
4
by: dixie | last post by:
Help, I'm really out of my depth here (not unusual I hear you say :-). I have just installed HTML Help in an application. I told it in the Project Properties the path to the help file. I then...
5
by: Steve | last post by:
I have written a help file (chm) for a DLL and referenced it using Help.ShowHelp My expectation is that a developer using my DLL would be able to access this help file during his development time...
10
by: JonathanOrlev | last post by:
Hello everybody, I wrote this comment in another message of mine, but decided to post it again as a standalone message. I think that Microsoft's Office 2003 help system is horrible, probably...
1
by: trunxnirvana007 | last post by:
'UPGRADE_WARNING: Array has a new behavior. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="9B7D5ADD-D8FE-4819-A36C-6DEDAF088CC7"' 'UPGRADE_WARNING: Couldn't resolve...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.