Thread overview
[Issue 22722] ImportC: parser doesn’t understand `asm volatile` syntax
January 31
https://issues.dlang.org/show_bug.cgi?id=22722

dave287091@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ImportC

--
February 02
https://issues.dlang.org/show_bug.cgi?id=22722

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
It does more than not accept the `volatile`, it also does not accept the `( ... )` construct. I'm not sure what to do about it. There are no plans to implement the gnu assembler syntax.

--
February 02
https://issues.dlang.org/show_bug.cgi?id=22722

--- Comment #2 from dave287091@gmail.com ---
(In reply to Walter Bright from comment #1)
> It does more than not accept the `volatile`, it also does not accept the `( ... )` construct. I'm not sure what to do about it. There are no plans to implement the gnu assembler syntax.

It’s unfortunate as it is not even using the asm, it’s just to inhibit compiler optimizations. If __GNUC__ is not defined it defines it as do { } while(0).

--
February 10
https://issues.dlang.org/show_bug.cgi?id=22722

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=22161

--
September 23
https://issues.dlang.org/show_bug.cgi?id=22722

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
> If __GNUC__ is not defined it defines it as do { } while(0)

__GNUC__ is for compiling with gcc. It's not a good idea for ImportC to pretend to be gcc.

--
September 26
https://issues.dlang.org/show_bug.cgi?id=22722

--- Comment #4 from dave287091@gmail.com ---
(In reply to Walter Bright from comment #3)
> > If __GNUC__ is not defined it defines it as do { } while(0)
> 
> __GNUC__ is for compiling with gcc. It's not a good idea for ImportC to pretend to be gcc.

clang also defines __GNUC__. There are other ways extensions like gnu asm can make it into headers, like `#if __has_extension(gnu_asm)`

--