Thread overview
[Issue 23584] ImportC: __builtin_bit_cast not supported
[Issue 23584] ImportC: expression expected, not `unsigned`
Dec 27, 2022
Jacob Carlborg
Dec 27, 2022
Iain Buclaw
Dec 28, 2022
Jacob Carlborg
Jan 09, 2023
Walter Bright
Jan 09, 2023
Walter Bright
Jan 09, 2023
Dlang Bot
Jan 09, 2023
Dlang Bot
December 27, 2022
https://issues.dlang.org/show_bug.cgi?id=23584

Jacob Carlborg <doob@me.com> changed:

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

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

Iain Buclaw <ibuclaw@gdcproject.org> changed:

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

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Why do you expect DMD to implement GDC/GCC built-ins?  (LDC might support them via Clang too, but is not guaranteed).

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

--- Comment #2 from Jacob Carlborg <doob@me.com> ---
I'm just trying to compile a C project and reporting compile errors as they appear.

The module __builtins.di already contains subs or implementations of a couple of __builtins. Since it's not possible to pass types to regular functions a macro needs to be added to importc.h that rewrites it to something that DMD can handle. I added the following to importc.h:

#define __builtin_bit_cast(type,expr) (type) expr

And then could at least continue compiling until the next error.

--
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23584

Walter Bright <bugzilla@digitalmars.com> changed:

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

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
Jacob, yes please on posting everything you run into.

--
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23584

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ImportC: expression         |ImportC: __builtin_bit_cast
                   |expected, not `unsigned`    |not supported

--
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23584

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #14795 "fix Issue 23584 - ImportC: __builtin_bit_cast not supported" fixing this issue:

- fix Issue 23584 - ImportC: __builtin_bit_cast not supported

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

--
January 09, 2023
https://issues.dlang.org/show_bug.cgi?id=23584

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14795 "fix Issue 23584 - ImportC: __builtin_bit_cast not supported" was merged into master:

- 9ffb041d07cc5b3b47a803a18d1b7b31a6e79d6b by Walter Bright:
  fix Issue 23584 - ImportC: __builtin_bit_cast not supported

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

--