ide project vs. command_line
This is a multi-part message in MIME format.
------=_NextPart_000_000C_01C76C9A.60D28040
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi there,
I'm trying to switch to VS 2005, there are some problems with porting =
existing code. I found something interesting in the project environment =
with this code:
#include <stdio.h>
#include <stdlib.h>
void abcd(char *dummy,int si,int value)
{
int x;
x = si;
// VC++ 6.0 shows, si = 0, value = 5
// Visual Studio 2005 shows , si = 1 (in project)
// command line "cl <file> shows si=0
// in ide project, si=1, value=0
printf("si = %i value = %i",si,value);
}
void main(void)
{
int si;
si = 0;
short int iblock[2] = {0,1};
abcd("do something",si,iblock[si++]);
}
-------------
I don't think it's a optimization issue, since the IDE debug is turn off =
(disable) optimization. In Visual C++, I gotten the value of the index =
is (si=0) inside the body of the subroutine. In Visual Studio 2005, =
the value (si=1) inside the body.
Does anyone know which compiler feature this is so I can turn it off?
Thanks,
Robert
------=_NextPart_000_000C_01C76C9A.60D28040
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; =
charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16414" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Hi there,</FONT></DIV>
<DIV><FONT face=Arial size=2> I'm trying to switch to VS 2005, =
there are
some problems with porting existing code. I found something =
interesting in
the project environment with this code:</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT =
size=2></FONT></FONT> </DIV>
<DIV><FONT face=Arial size=2><FONT size=2>#include =
<stdio.h><BR>#include
<stdlib.h></DIV>
<DIV>
<P>void abcd(char *dummy,int si,int =
value)<BR>{<BR> int
x;<BR> x = si;<BR> // VC++ 6.0 =
shows, si = 0,
value = 5<BR> // Visual Studio 2005 shows , si = 1 (in =
project)<BR> //
command line "cl <file> shows si=0<BR> // in ide project, =
si=1,
value=0<BR> printf("si = %i value =
%i",si,value);<BR>}</P>
<P>void main(void)<BR>{<BR> int
si;<BR> si = 0;<BR> =
short int
iblock[2] = {0,1};<BR> abcd("do
something",si,iblock[si++]);<BR>}<BR>-------------</P>
<P>I don't think it's a optimization issue, since the IDE debug is turn =
off
(disable) optimization. In Visual C++, I gotten the value of the =
index is
(si=0) inside the body of the subroutine. In Visual Studio 2005, =
the value
(si=1) inside the body.</P>
<P>Does anyone know which compiler feature this is so I can turn it =
off?</P>
<P>Thanks,<BR>Robert</P></FONT></FONT></DIV></BODY></HTML>
------=_NextPart_000_000C_01C76C9A.60D28040--