Strange problem with VC++ compiler because of goto

Hello,

Today I found a serious problem in the following code when I compiled with VC++ 6.
The installed compiler & linker versions are 12.00.8804, 6.00.8447 on x86 system respectively.

#include <stdio.h>
int alloc()
{
return 0;
}

int main(int argc, char* argv)
{
printf(“Testing!\n”);

if(alloc() == 0)
goto Radhe;

return 0;

Radhe:
printf(“Hello\n”);
}

I expected that “Hello” will be printed just once because, the if statement jumps the instruction pointer to the label.

But “Hello” is priting always till I kill the process.
When I check the assembly code, I found a JMP instruction right after printf(“Hello\n”) line, instead of a RET instruction.

I don’t know whether this is known bug in VC compilers or microsoft standard. I just want to share this with all of experts here.

If this is the wrong place to post, please ignore.

Regards,
Raja Reddy.

---------------------------------
Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.</stdio.h>

I don’t mean the snap but.



You shouldn’t use gotos. Avoid them. In a world of exceptions and
encapsulated init/deinit there is no need for gotos. I recently saw a code
with gotos INSIDE a loop that went UP and since that minute I decided that
my tolerance toward gotos ended.

EA

From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Raja Reddy
Sent: jeudi 17 mai 2007 06:44
To: Windows System Software Devs Interest List
Subject: [ntdev] Strange problem with VC++ compiler because of goto

Hello,

Today I found a serious problem in the following code when I compiled with
VC++ 6.

The installed compiler & linker versions are 12.00.8804, 6.00.8447 on x86
system respectively.

#include <stdio.h>

int alloc()
{
return 0;
}

int main(int argc, char* argv)
{
printf(“Testing!\n”);

if(alloc() == 0)
goto Radhe;

return 0;

Radhe:

printf(“Hello\n”);

}

I expected that “Hello” will be printed just once because, the if statement
jumps the instruction pointer to the label.

But “Hello” is priting always till I kill the process.

When I check the assembly code, I found a JMP instruction right after
printf(“Hello\n”) line, instead of a RET instruction.

I don’t know whether this is known bug in VC compilers or microsoft
standard. I just want to share this with all of experts here.

If this is the wrong place to post, please ignore.

Regards,

Raja Reddy.

_____

Park yourself in front of a world of choices in alternative vehicles.
Visit
http:X3oDMTE5cDF2bXZzBF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDZ3JlZW4tY2VudGVy>
the Yahoo! Auto Green Center. — Questions? First check the Kernel Driver
FAQ at http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</http:></stdio.h>

I find that goto’s are one of the most singularly useful constructs
there is. Just one or two, placed at strategic points in the code, will
derail any serious code review while the participant flame each other
into fits and ignoring the substance of the code. Goto’s also work great
for turning ntdev into slashdot. Any thoughts on genetically altered
corn?



> I don’t mean the snap but…
>
>
>
> You shouldn’t use gotos. Avoid them. In a world of exceptions and
> encapsulated init/deinit there is no need for gotos. I recently saw a
> code with gotos INSIDE a loop that went UP and since that minute I
> decided that my tolerance toward gotos ended.
>
>
>
> –
>
> EA
>
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com] *On Behalf Of Raja Reddy
> Sent: jeudi 17 mai 2007 06:44
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Strange problem with VC++ compiler because of goto
>
> Hello,
>
> Today I found a serious problem in the following code when I compiled
> with VC++ 6.
>
> The installed compiler & linker versions are 12.00.8804, 6.00.8447 on
> x86 system respectively.
>
> #include <stdio.h>
>
> int alloc()
> {
> return 0;
> }
>
> int main(int argc, char
argv)
> {
> printf(“Testing!\n”);
>
> if(alloc() == 0)
> goto Radhe;
>
> return 0;
>
> Radhe:
>
> printf(“Hello\n”);
>
> }
>
> I expected that “Hello” will be printed just once because, the if
> statement jumps the instruction pointer to the label.
>
> But “Hello” is priting always till I kill the process.
>
> When I check the assembly code, I found a JMP instruction right after
> printf(“Hello\n”) line, instead of a RET instruction.
>
> I don’t know whether this is known bug in VC compilers or microsoft
> standard. I just want to share this with all of experts here.
>
> If this is the wrong place to post, please ignore.
>
> Regards,
>
> Raja Reddy.
>
> ------------------------------------------------------------------------
>
> Park yourself in front of a world of choices in alternative vehicles.
> Visit the Yahoo! Auto Green Center.
> http:
> — Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
> List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer</http:></stdio.h>

> You shouldn’t use gotos. Avoid them. In a world of exceptions and

encapsulated init/deinit there is no need for gotos.

Kernel does not support C++ exceptions.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

dont have msvc handy but it looks like gcc is compiling this ok
it prints the hello once and exits and the disassembly looks ok

cat spin.c
#include <stdio.h>
int alloc()
{
return 0;
}

int main(int argc, char* argv)
{
printf(“Testing!\n”);

if(alloc() == 0)
goto Radhe;

return 0;

Radhe:
printf(“Hello\n”);
}

/spin> gdb -q -n ./spin

(gdb)set di i
(gdb) disassemble main
Dump of assembler code for function main:
0x08048346 : push ebp
0x08048347 : mov ebp,esp
0x08048349 : sub esp,0x8
0x0804834c : and esp,0xfffffff0
0x0804834f : mov eax,0x0
0x08048354 : sub esp,eax
0x08048356 : sub esp,0xc
0x08048359 : push 0x80484a8
0x0804835e : call 0x8048268
0x08048363 : add esp,0x10
0x08048366 : call 0x804833c
0x0804836b : test eax,eax
0x0804836d : jne 0x8048371
0x0804836f : jmp 0x804837a
0x08048371 : mov DWORD PTR [ebp-4],0x0
0x08048378 : jmp 0x804838a
0x0804837a : sub esp,0xc
0x0804837d : push 0x80484b2
0x08048382 : call 0x8048268
0x08048387 : add esp,0x10
0x0804838a : mov eax,DWORD PTR [ebp-4]
0x0804838d : leave
0x0804838e : ret
End of assembler dump.
(gdb) q
~/spin> ./spin
Testing!
Hello
~/spin>

On 5/17/07, Raja Reddy wrote:
> Hello,
>
> Today I found a serious problem in the following code when I compiled with
> VC++ 6.
> The installed compiler & linker versions are 12.00.8804, 6.00.8447 on x86
> system respectively.
>
> #include <stdio.h>
> int alloc()
> {
> return 0;
> }
>
> int main(int argc, char* argv)
> {
> printf(“Testing!\n”);
>
> if(alloc() == 0)
> goto Radhe;
>
> return 0;
>
> Radhe:
> printf(“Hello\n”);
> }
> I expected that “Hello” will be printed just once because, the if statement
> jumps the instruction pointer to the label.
>
> But “Hello” is priting always till I kill the process.
> When I check the assembly code, I found a JMP instruction right after
> printf(“Hello\n”) line, instead of a RET instruction.
>
> I don’t know whether this is known bug in VC compilers or microsoft
> standard. I just want to share this with all of experts here.
>
> If this is the wrong place to post, please ignore.
>
> Regards,
> Raja Reddy.
>
>
> ________________________________
> Park yourself in front of a world of choices in alternative vehicles.
> Visit the Yahoo! Auto Green Center. — Questions? First check the Kernel
> Driver FAQ at http://www.osronline.com/article.cfm?id=256
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
></stdio.h></stdio.h>

To avoid this problem the best is to have strict guidelines about that kind
of stuff within your team(s). When new people come into the team they are
made aware of the rules, which are:

1/You do not talk about GOTO
2/You DO NOT talk about GOTO

EA

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-286997-
xxxxx@lists.osr.com] On Behalf Of Robert Kennett
Sent: jeudi 17 mai 2007 09:06
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Strange problem with VC++ compiler because of goto

I find that goto’s are one of the most singularly useful constructs
there is. Just one or two, placed at strategic points in the code, will
derail any serious code review while the participant flame each other
into fits and ignoring the substance of the code. Goto’s also work
great
for turning ntdev into slashdot. Any thoughts on genetically altered
corn?
>
>
>
> > I don’t mean the snap but.
> >
> >
> >
> > You shouldn’t use gotos. Avoid them. In a world of exceptions and
> > encapsulated init/deinit there is no need for gotos. I recently saw a
> > code with gotos INSIDE a loop that went UP and since that minute I
> > decided that my tolerance toward gotos ended.
> >
> >
> >
> > –
> >
> > EA
> >
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] *On Behalf Of Raja Reddy
> > Sent: jeudi 17 mai 2007 06:44
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Strange problem with VC++ compiler because of goto
> >
> > Hello,
> >
> > Today I found a serious problem in the following code when I compiled
> > with VC++ 6.
> >
> > The installed compiler & linker versions are 12.00.8804, 6.00.8447 on
> > x86 system respectively.
> >
> > #include <stdio.h>
> >
> > int alloc()
> > {
> > return 0;
> > }
> >
> > int main(int argc, char
argv)
> > {
> > printf(“Testing!\n”);
> >
> > if(alloc() == 0)
> > goto Radhe;
> >
> > return 0;
> >
> > Radhe:
> >
> > printf(“Hello\n”);
> >
> > }
> >
> > I expected that “Hello” will be printed just once because, the if
> > statement jumps the instruction pointer to the label.
> >
> > But “Hello” is priting always till I kill the process.
> >
> > When I check the assembly code, I found a JMP instruction right after
> > printf(“Hello\n”) line, instead of a RET instruction.
> >
> > I don’t know whether this is known bug in VC compilers or microsoft
> > standard. I just want to share this with all of experts here.
> >
> > If this is the wrong place to post, please ignore.
> >
> > Regards,
> >
> > Raja Reddy.
> >
> > ---------------------------------------------------------------------
> —
> >
> > Park yourself in front of a world of choices in alternative vehicles.
> > Visit the Yahoo! Auto Green Center.
> >
> http:> _ylc=X3oDMTE5cDF2bXZzBF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDZ3JlZW4tY2
> VudGVy>
> > — Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
> > List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer</http:></stdio.h>

well not hoping to turn this thread into a you you me me flame war

but gotos do have thier use and i ve seen some very good code being
being emitted when using gotos

and being constantly fed wtih propaganda against using gotos i asked someone
about the phenomena
i have a the best possible code emitted by the compiler when i am using goto
in my c source (no embedded jumps inserted but compiler was clever
enough to seamlessly merge the code into a single proc with goto)

but it seems every tom dick and harry and his poodle out there is
fanatic about me not using goto

and he replied something in this vein

using goto is like dividing by zero
in school mathematics dividing by zero is impossible cannot be done
in highschool mathematics you get the tone of dividing by zero is
acceptable with certain caveats

when you are doing college mathematics
you can certainly divide by zero and derive a result that tends to some limit

not sure the analogy fits in or not but i do believe in some cases
gotos have the best possible outcome of compiled code

no flames please

On 5/17/07, Edouard A. wrote:
> To avoid this problem the best is to have strict guidelines about that kind
> of stuff within your team(s). When new people come into the team they are
> made aware of the rules, which are:
>
> 1/You do not talk about GOTO
> 2/You DO NOT talk about GOTO
>
> –
>
> EA
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com [mailto:bounce-286997-
> > xxxxx@lists.osr.com] On Behalf Of Robert Kennett
> > Sent: jeudi 17 mai 2007 09:06
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] Strange problem with VC++ compiler because of goto
> >
> > I find that goto’s are one of the most singularly useful constructs
> > there is. Just one or two, placed at strategic points in the code, will
> > derail any serious code review while the participant flame each other
> > into fits and ignoring the substance of the code. Goto’s also work
> > great
> > for turning ntdev into slashdot. Any thoughts on genetically altered
> > corn?
> >
> >
> >
> > > I don’t mean the snap but.
> > >
> > >
> > >
> > > You shouldn’t use gotos. Avoid them. In a world of exceptions and
> > > encapsulated init/deinit there is no need for gotos. I recently saw a
> > > code with gotos INSIDE a loop that went UP and since that minute I
> > > decided that my tolerance toward gotos ended.
> > >
> > >
> > >
> > > –
> > >
> > > EA
> > >
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] *On Behalf Of Raja Reddy
> > > Sent: jeudi 17 mai 2007 06:44
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] Strange problem with VC++ compiler because of goto
> > >
> > > Hello,
> > >
> > > Today I found a serious problem in the following code when I compiled
> > > with VC++ 6.
> > >
> > > The installed compiler & linker versions are 12.00.8804, 6.00.8447 on
> > > x86 system respectively.
> > >
> > > #include <stdio.h>
> > >
> > > int alloc()
> > > {
> > > return 0;
> > > }
> > >
> > > int main(int argc, char
argv)
> > > {
> > > printf(“Testing!\n”);
> > >
> > > if(alloc() == 0)
> > > goto Radhe;
> > >
> > > return 0;
> > >
> > > Radhe:
> > >
> > > printf(“Hello\n”);
> > >
> > > }
> > >
> > > I expected that “Hello” will be printed just once because, the if
> > > statement jumps the instruction pointer to the label.
> > >
> > > But “Hello” is priting always till I kill the process.
> > >
> > > When I check the assembly code, I found a JMP instruction right after
> > > printf(“Hello\n”) line, instead of a RET instruction.
> > >
> > > I don’t know whether this is known bug in VC compilers or microsoft
> > > standard. I just want to share this with all of experts here.
> > >
> > > If this is the wrong place to post, please ignore.
> > >
> > > Regards,
> > >
> > > Raja Reddy.
> > >
> > > ---------------------------------------------------------------------
> > —
> > >
> > > Park yourself in front of a world of choices in alternative vehicles.
> > > Visit the Yahoo! Auto Green Center.
> > >
> > http:> > _ylc=X3oDMTE5cDF2bXZzBF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDZ3JlZW4tY2
> > VudGVy>
> > > — Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
> > > List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServer
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
></http:></stdio.h>

Surely the only important issue here is (as Maxim said) that any complier
should issue an error that not all control paths return a value. Any that
don’t have not parsed it correctly.

Since the source code is invalid C the results if it does (appear to)
compile must be garbage.

I think we all find complier anomalies from time to time, presumably most
people, like me, find a workaround and move on. Reporting it to the supplier
is more public spirited, but we seldom have time.

BTW I thought goto was a valid part of the language. Most of us were taught
that a good rule of thumb is to avoid them as there is often a better
architecture. These rules are of course for the the guidance of the wise
(and the obediance of ??? - I can’t remember the original quote…).

Mike

----- Original Message -----
From: raj_r
To: Windows System Software Devs Interest List
Sent: Thursday, May 17, 2007 9:08 AM
Subject: Re: [ntdev] Strange problem with VC++ compiler because of goto

well not hoping to turn this thread into a you you me me flame war

but gotos do have thier use and i ve seen some very good code being
being emitted when using gotos

and being constantly fed wtih propaganda against using gotos i asked someone
about the phenomena
i have a the best possible code emitted by the compiler when i am using goto
in my c source (no embedded jumps inserted but compiler was clever
enough to seamlessly merge the code into a single proc with goto)

but it seems every tom dick and harry and his poodle out there is
fanatic about me not using goto

and he replied something in this vein

using goto is like dividing by zero
in school mathematics dividing by zero is impossible cannot be done
in highschool mathematics you get the tone of dividing by zero is
acceptable with certain caveats

when you are doing college mathematics
you can certainly divide by zero and derive a result that tends to some
limit

not sure the analogy fits in or not but i do believe in some cases
gotos have the best possible outcome of compiled code

no flames please

On 5/17/07, Edouard A. wrote:
> To avoid this problem the best is to have strict guidelines about that
> kind
> of stuff within your team(s). When new people come into the team they are
> made aware of the rules, which are:
>
> 1/You do not talk about GOTO
> 2/You DO NOT talk about GOTO
>
> –
>
> EA
>
> > -----Original Message-----
> > From: xxxxx@lists.osr.com [mailto:bounce-286997-
> > xxxxx@lists.osr.com] On Behalf Of Robert Kennett
> > Sent: jeudi 17 mai 2007 09:06
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] Strange problem with VC++ compiler because of goto
> >
> > I find that goto’s are one of the most singularly useful constructs
> > there is. Just one or two, placed at strategic points in the code, will
> > derail any serious code review while the participant flame each other
> > into fits and ignoring the substance of the code. Goto’s also work
> > great
> > for turning ntdev into slashdot. Any thoughts on genetically altered
> > corn?
> >
> >
> >
> > > I don’t mean the snap but.
> > >
> > >
> > >
> > > You shouldn’t use gotos. Avoid them. In a world of exceptions and
> > > encapsulated init/deinit there is no need for gotos. I recently saw a
> > > code with gotos INSIDE a loop that went UP and since that minute I
> > > decided that my tolerance toward gotos ended.
> > >
> > >
> > >
> > > –
> > >
> > > EA
> > >
> > > From: xxxxx@lists.osr.com
> > > [mailto:xxxxx@lists.osr.com] *On Behalf Of Raja Reddy
> > > Sent: jeudi 17 mai 2007 06:44
> > > To: Windows System Software Devs Interest List
> > > Subject: [ntdev] Strange problem with VC++ compiler because of goto
> > >
> > > Hello,
> > >
> > > Today I found a serious problem in the following code when I compiled
> > > with VC++ 6.
> > >
> > > The installed compiler & linker versions are 12.00.8804, 6.00.8447 on
> > > x86 system respectively.
> > >
> > > #include <stdio.h>
> > >
> > > int alloc()
> > > {
> > > return 0;
> > > }
> > >
> > > int main(int argc, char
argv)
> > > {
> > > printf(“Testing!\n”);
> > >
> > > if(alloc() == 0)
> > > goto Radhe;
> > >
> > > return 0;
> > >
> > > Radhe:
> > >
> > > printf(“Hello\n”);
> > >
> > > }
> > >
> > > I expected that “Hello” will be printed just once because, the if
> > > statement jumps the instruction pointer to the label.
> > >
> > > But “Hello” is priting always till I kill the process.
> > >
> > > When I check the assembly code, I found a JMP instruction right after
> > > printf(“Hello\n”) line, instead of a RET instruction.
> > >
> > > I don’t know whether this is known bug in VC compilers or microsoft
> > > standard. I just want to share this with all of experts here.
> > >
> > > If this is the wrong place to post, please ignore.
> > >
> > > Regards,
> > >
> > > Raja Reddy.
> > >
> > > ---------------------------------------------------------------------
> > —
> > >
> > > Park yourself in front of a world of choices in alternative vehicles.
> > > Visit the Yahoo! Auto Green Center.
> > >
> > http:> > _ylc=X3oDMTE5cDF2bXZzBF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDZ3JlZW4tY2
> > VudGVy>
> > > — Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the
> > > List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServer
> > >
> > >
> > > —
> > > Questions? First check the Kernel Driver FAQ at
> > > http://www.osronline.com/article.cfm?id=256
> > >
> > > To unsubscribe, visit the List Server section of OSR Online at
> > > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of OSR Online at
> > http://www.osronline.com/page.cfm?name=ListServer
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer</http:></stdio.h>

Raja,

I just took your code ( as is cut and paste), created a console app using
vc6 ( did not look at the version sp and other detail of my installation).
Add the code to a new file and compiled and run …

Compiler output -

--------------------Configuration: ComplierTest - Win32
Debug--------------------
Compiling…
compliertest.c
c:\src\compliertest\compliertest.c(18) : warning C4715: ‘main’ : not all
control paths return a value
Linking…

ComplierTest.exe - 0 error(s), 1 warning(s)
Running the debug version ( the output is )

C:\src\ComplierTest\Debug>ComplierTest.exe
Testing!
Hello

-pro

On 5/16/07, Raja Reddy wrote:
>
> Hello,
>
> Today I found a serious problem in the following code when I compiled with
> VC++ 6.
> The installed compiler & linker versions are 12.00.8804, 6.00.8447 on x86
> system respectively.
>
> #include <stdio.h>
> int alloc()
> {
> return 0;
> }
>
> int main(int argc, char* argv)
> {
> printf(“Testing!\n”);
>
> if(alloc() == 0)
> goto Radhe;
>
> return 0;
>
> Radhe:
> printf(“Hello\n”);
> }
>
> I expected that “Hello” will be printed just once because, the if
> statement jumps the instruction pointer to the label.
>
> But “Hello” is priting always till I kill the process.
> When I check the assembly code, I found a JMP instruction right after
> printf(“Hello\n”) line, instead of a RET instruction.
>
> I don’t know whether this is known bug in VC compilers or microsoft
> standard. I just want to share this with all of experts here.
>
> If this is the wrong place to post, please ignore.
>
> Regards,
> Raja Reddy.
>
>
> ------------------------------
> Park yourself in front of a world of choices in alternative vehicles.
> Visit the Yahoo! Auto Green Center.http:— Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256 To unsubscribe, visit the List
> Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
></http:></stdio.h>