_asm NOP : undeclared identifier

S

Saurabh Aggrawal

Hi,

if (iter->m_name.compare(pstrName) == 0)
{
// Provide our object.
*ppunkItem = iter->m_pUnknown;
// Addref our object...
iter->m_pUnknown->AddRef();
break;
}
else
{
_asm NOP;
}

I am getting the errors:

abc.cpp(223) : error C2065: '_asm' : undeclared identifier
abc.cpp(223) : error C2146: syntax error : missing ';' before
identifier 'NOP'
abc.cpp(223) : error C2065: 'NOP' : undeclared identifier


Could anyone suggest me the solution for these errors.
respects,
Saurabh Aggrawal
 
M

msalters

Saurabh said:
Hi,

if (iter->m_name.compare(pstrName) == 0)
{
// Provide our object.
*ppunkItem = iter->m_pUnknown;
// Addref our object...
iter->m_pUnknown->AddRef();
break;
}
else
{
_asm NOP;
}

I am getting the errors:

abc.cpp(223) : error C2065: '_asm' : undeclared identifier
abc.cpp(223) : error C2146: syntax error : missing ';' before
identifier 'NOP'
abc.cpp(223) : error C2065: 'NOP' : undeclared identifier

Sure. _asm isn't C++. I guess the C++ equivalent would be a semicolon
by itself. Of course, if that program contains more
non-C++, that may need to be changed too.

Regards,
Michiel Salters
 
T

Thomas Matthews

msalters said:
Sure. _asm isn't C++. I guess the C++ equivalent would be a semicolon
by itself. Of course, if that program contains more
non-C++, that may need to be changed too.

Regards,
Michiel Salters

Be aware though, that the compiler may optimize away
any null statements. Forcing the compiler not to is
another task entirely.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top