Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to change comple warning level by project setting ? Pin
includeh1020-Sep-09 5:36
includeh1020-Sep-09 5:36 
Questionis it possible to get warning message from UINT value mismatched? Pin
includeh1020-Sep-09 4:28
includeh1020-Sep-09 4:28 
AnswerRe: is it possible to get warning message from UINT value mismatched? Pin
Richard MacCutchan20-Sep-09 4:35
mveRichard MacCutchan20-Sep-09 4:35 
GeneralRe: is it possible to get warning message from UINT value mismatched? Pin
includeh1020-Sep-09 4:43
includeh1020-Sep-09 4:43 
GeneralRe: is it possible to get warning message from UINT value mismatched? Pin
Richard MacCutchan20-Sep-09 5:10
mveRichard MacCutchan20-Sep-09 5:10 
GeneralRe: is it possible to get warning message from UINT value mismatched? Pin
includeh1020-Sep-09 5:20
includeh1020-Sep-09 5:20 
GeneralRe: is it possible to get warning message from UINT value mismatched? Pin
KarstenK21-Sep-09 2:56
mveKarstenK21-Sep-09 2:56 
QuestionDifferent results with debug and release version of simulation program Pin
mass8520-Sep-09 3:37
mass8520-Sep-09 3:37 
Hi
I have a strange situation. My simulation written in VS 2008 return wrong results for release version of program run from HDD. When I run this program for the same set of parameters from the VS using release or debug version, or when I run debug version from HDD, I get correct results.

What's more interesting I can interpret wrong results. They look like they were generated by wrong parameter or wrong conditional expression in one single line.

Here is the correct code:
double temp = generator.getUpLinkRandom(staAddress);
	t += temp;   //for testing of the generator's average
	cntr++;      //for testing of the generator's average
	if (temp < upLinkRatio){
		//packet will be sent from STA to AP
		msdu->DA = 0;
		msdu->TA = msdu->SA = staAddress;
	}else{
		//packet will be sent from AP to STA
		msdu->SA = msdu->TA = 0;
		msdu->DA = staAddress;
	}

I set the upLinkRatio to 0.2, but wrong results look like upLinkRatio was set to 0.8 or optimiser changed conditional expression to:
if (temp > upLinkRatio)

I tested the generator's average and it's correct (0.5, this is uniform generator, return values from 0 to 1). I cleaned project, deleted all object files. I made sure that all files with parameters are exactly the same. And still can't find the reason.

Edit:
There's something even more interesting. Just for curosity I changed this conditional expression to the wrong version and now the situation is exactly opposite. Relaese version run from HDD returns correct results, whereas all other wrong (which is what I expect - code is wrong).

So it looks like there is something wrong with compiler/builder... But what? Please help.
AnswerRe: Different results with debug and release version of simulation program Pin
Chris Losinger20-Sep-09 4:08
professionalChris Losinger20-Sep-09 4:08 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 4:23
mass8520-Sep-09 4:23 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 4:33
mveRichard MacCutchan20-Sep-09 4:33 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 4:46
mass8520-Sep-09 4:46 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 5:00
mveRichard MacCutchan20-Sep-09 5:00 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 5:24
mass8520-Sep-09 5:24 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 7:20
mveRichard MacCutchan20-Sep-09 7:20 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 9:47
mass8520-Sep-09 9:47 
GeneralRe: Different results with debug and release version of simulation program Pin
CPallini20-Sep-09 10:01
mveCPallini20-Sep-09 10:01 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:12
mass8520-Sep-09 10:12 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 10:08
mveRichard MacCutchan20-Sep-09 10:08 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:26
mass8520-Sep-09 10:26 
GeneralRe: Different results with debug and release version of simulation program Pin
Richard MacCutchan20-Sep-09 10:35
mveRichard MacCutchan20-Sep-09 10:35 
GeneralRe: Different results with debug and release version of simulation program Pin
mass8520-Sep-09 10:54
mass8520-Sep-09 10:54 
Question[SOLVED}How to activate a menu [modified] Pin
simion31420-Sep-09 0:31
simion31420-Sep-09 0:31 
AnswerRe: How to activate a menu Pin
GameZelda20-Sep-09 0:58
GameZelda20-Sep-09 0:58 
QuestionBinding a Memo Field Pin
Cal Brass19-Sep-09 14:48
Cal Brass19-Sep-09 14:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.