Thread overview
[Issue 22976] importC: address-of with struct pointer and array member gives wrong result
Apr 05, 2022
Walter Bright
Apr 17, 2022
duser@neet.fi
[Issue 22976] importC: fails to multiply by element size when doing address-of
Apr 18, 2022
Walter Bright
Apr 18, 2022
Dlang Bot
Apr 18, 2022
Dlang Bot
April 05, 2022
https://issues.dlang.org/show_bug.cgi?id=22976

Walter Bright <bugzilla@digitalmars.com> changed:

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

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
Probably forgot to multiply by sizeof.

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

--- Comment #2 from duser@neet.fi ---
Created attachment 1846
  --> https://issues.dlang.org/attachment.cgi?id=1846&action=edit
fix

attaching my patch i've been using that fixes this

--
April 18, 2022
https://issues.dlang.org/show_bug.cgi?id=22976

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|importC: address-of with    |importC: fails to multiply
                   |struct pointer and array    |by element size when doing
                   |member gives wrong result   |address-of

--
April 18, 2022
https://issues.dlang.org/show_bug.cgi?id=22976

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

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

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #14005 "fix Issue 22976 - importC: fails to multiply by element size when doi…" fixing this issue:

- fix Issue 22976 - importC: fails to multiply by element size when doing address-of

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

--
April 18, 2022
https://issues.dlang.org/show_bug.cgi?id=22976

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

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

--- Comment #4 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14005 "fix Issue 22976 - importC: fails to multiply by element size when doi…" was merged into master:

- 1f561d908198c96e62b899370d16f4b4588da05d by Walter Bright:
  fix Issue 22976 - importC: fails to multiply by element size when doing
address-of

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

--