www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20593] New: [GCC ASM] Parser syntax for asm operands differs

https://issues.dlang.org/show_bug.cgi?id=20593

          Issue ID: 20593
           Summary: [GCC ASM] Parser syntax for asm operands differs from
                    GCC
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

This is permitted in D.

    asm { "cpuid" : "=a" a; }

But the documented syntax in gcc says that the expression/variable should be
around parentheses
(https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#InputOperands)


The old (incorrect) syntax should be deprecated in favour of:

    asm { "cpuid" : "=a" (a); }

--
Feb 22