This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Question regarding C++ and inline assembler...


The following code fragment generates a error when compiled as C++ code, but not
as C code.

int main (int argc, char **argv)
{
  __asm__ ("mov r0, #0", ::: "r0");	/* error in C++, not C */
  __asm__ ("mov r0, #0", : : : "r0");   /* fine in C and C++ */
}

Shouldn't the C++ compiler be able to cope with no whitespace between the colons
when compiling the inline assembler?

Scott

-- 
Scott Bambrough - Software Engineer
REBEL.COM    http://www.rebel.com
NetWinder    http://www.netwinder.org

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]