Click here to Skip to main content
Click here to Skip to main content
Technical Blog

Tagged as

__asm int 3 in template function ( in VC6 )

, 8 Apr 2009 CPOL
Rate this:
Please Sign up or sign in to vote.
We usually use __asm int 3 in the code to hard code break points. But have you tried setting a __asm int 3 in a template function? Like...templateclass T> int Testfunc( T Obj ){__asm int 3;return Obj++;}void main(){Testfunc( 1 );};The above code will never get compiled in vc6. It will generate the b

We usually use __asm int 3 in the code to hard code break points. But have you tried setting a __asm int 3 in a template function? Like...

template<</>class T> int Testfunc( T Obj )
{
__asm int 3;
return Obj++;
}

void main()
{
Testfunc( 1 );
};

The above code will never get compiled in vc6. It will generate the below error


"fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 1794)
Please choose the Technical Support command on the Visual C++ Help menu, or open the Technical Support help file for more information
Generating Code...Command line warning D4028 : minimal rebuild failure, reverting to normal build
Error executing cl.exe."

But the same code will compile fine in later versions of visual studio. Seems they have fixed the bug Smile | :)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Naveen
Software Developer (Senior)
Singapore Singapore
No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 PinmemberMizan Rahman9-Aug-11 0:20 
Questionso whats the solution? Not to use this in VC6? PinmemberAnandChavali8-Apr-09 20:33 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.141220.1 | Last Updated 8 Apr 2009
Article Copyright 2009 by Naveen
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid