Thread overview
[Issue 22722] ImportC: parser doesn’t understand `asm volatile` syntax
Feb 02, 2022
Walter Bright
Feb 10, 2022
Walter Bright
Sep 23, 2022
Walter Bright
Dec 17, 2022
Iain Buclaw
Feb 16, 2023
Dlang Bot
Mar 20, 2023
Dlang Bot
January 31, 2022
https://issues.dlang.org/show_bug.cgi?id=22722

dave287091@gmail.com changed:

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

--
February 02, 2022
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, 2022
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, 2022
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, 2022
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, 2022
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)`

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=22722

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
February 16, 2023
https://issues.dlang.org/show_bug.cgi?id=22722

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ibuclaw created dlang/dmd pull request #14890 "partial fix Issue 22722 - ImportC: parser doesn’t understand 'asm volatile' syntax" mentioning this issue:

- partial fix Issue 22722 - ImportC: parser doesn’t understand 'asm volatile' syntax

https://github.com/dlang/dmd/pull/14890

--
March 20, 2023
https://issues.dlang.org/show_bug.cgi?id=22722

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14890 "partial fix Issue 22722 - ImportC: parser doesn’t understand 'asm volatile' syntax" was merged into master:

- a7af3a05452ac5ad8c70996f1eae18f196228b9c by Iain Buclaw:
  partial fix Issue 22722 - ImportC: parser doesn’t understand 'asm volatile'
syntax

https://github.com/dlang/dmd/pull/14890

--
March 22, 2023
https://issues.dlang.org/show_bug.cgi?id=22722

dave287091@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from dave287091@gmail.com ---
This bug was resolved by https://github.com/dlang/dmd/pull/15011

--