c++ - Ambiguous operand size -


what's wrong code? compiler returns ambiguous operand size dec in unlock function. but, there qword keyword (size specifier). and, finally, stupid system wants more details, haven't more details... (red box "it looks post code ... blah blah"). than, wrote more text ...

class spinlock {     qword locked; public:     spinlock() : locked(-1)     { }     void lock()     __attribute__((noinline));     void unlock()   __attribute__((noinline)); };  void spinlock::lock() {     asm(     ".intel_syntax noprefix;"     "xor rcx, rcx;"     "loop:;"     "lock xchg qword [%0], rcx;"     "test rcx, rcx;"     "jz loop;"     ".att_syntax noprefix;"     :      : "r"(&locked)     : "rcx"     ); }  void spinlock::unlock() {     asm(     ".intel_syntax noprefix;"     "lock dec qword [%0];"     ".att_syntax noprefix;"     :     : "r"(&locked)     :     ); } 


Comments

Popular posts from this blog

hibernate - How to load global settings frequently used in application in Java -

objective c - Ownership modifiers with manual reference counting -

python 3.x - Mapping specific letters onto a list of words -