473,799 Members | 3,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1364
"arber" <yx*@sfu.ca> wrote in message
news:74******** *************** ***@posting.goo gle.com...
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.********@com Acast.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.c om)
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
4417
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 the microsoft HTML workshop utility, lets call it c:\path\help.chm. My question is how do you launch it from the GUI? What logic do I put behind the "help" button, in other words. I thought it would be os.spawnv(os.P_DETACH,...
4
3358
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 cmd.Cmd but I would also like to get the man-page-like help for classes and functions. Does anyone know how to do that? Thanks. Sarir
2
6487
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
6
3026
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 an html authoring tool to help you accomplish? 2. What do you expect from online help for a html authoring tool? 3. What audience do you think a freeware html authoring tool is directed towards?
0
568
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 link doesn't work, basically here is the article: An Exploration Into Launching Context-Sensitive HTML Help with Topic IDs in VB.NET I spent this evening investigating the HTML Help API as implemented in
3
3368
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 numarray, help gives unhelpful responses:
4
2639
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 type in a command line that runs the help in the correct Context from a button on each form. It all worked fine - HERE. The problem is that when I sent it out to a site, the help file was not able to be accessed because it was my path in the...
5
3288
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 using "F1" help within the VB IDE. Is this expectation achievable In trying to test my help file in the IDE, I have a solution with 2 projects: the DLL and a tester. VB does not look for my help file; instead, it looks for path to my source code...
10
3370
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 the worst I ever seen. I almost cannot find anything I need, including things I
1
6142
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 default property of object Label. Click for more: 'ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"' Label = New Object(){Box1, Box2, Box3, Box4, Box5, Box6, Box7, Box8, Box9, Box10, Box11,...
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10490
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10243
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5590
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.