Jump to page: 1 2
Thread overview
[Issue 22877] importC: wrong sizeof for string literal
Mar 14, 2022
Walter Bright
Mar 15, 2022
Dlang Bot
Mar 15, 2022
Dlang Bot
Apr 26, 2022
Steven Dwy
Apr 26, 2022
Steven Dwy
Apr 26, 2022
Dlang Bot
Apr 26, 2022
Dlang Bot
May 01, 2022
Dlang Bot
May 02, 2022
Dlang Bot
May 09, 2022
Dlang Bot
Sep 16, 2022
Walter Bright
Dec 17, 2022
Iain Buclaw
Apr 02, 2023
Walter Bright
Apr 02, 2023
Walter Bright
March 14, 2022
https://issues.dlang.org/show_bug.cgi?id=22877

Walter Bright <bugzilla@digitalmars.com> changed:

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

--
March 15, 2022
https://issues.dlang.org/show_bug.cgi?id=22877

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

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

--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright created dlang/dmd pull request #13824 "fix Issue 22877 - importC: wrong sizeof for string literal" fixing this issue:

- fix Issue 22877 - importC: wrong sizeof for string literal

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

--
March 15, 2022
https://issues.dlang.org/show_bug.cgi?id=22877

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

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

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13824 "fix Issue 22877 - importC: wrong sizeof for string literal" was merged into master:

- 53850e9d5ec8cb276308edf1d652c1442d00b8de by Walter Bright:
  fix Issue 22877 - importC: wrong sizeof for string literal

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

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

Steven Dwy <me@yoplitein.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |me@yoplitein.net
         Resolution|FIXED                       |---

--- Comment #3 from Steven Dwy <me@yoplitein.net> ---
With this fix sizeof an address of a string literal is also the length of the
string:
```
const int s1 = sizeof("aa");
_Static_assert(s1 == 3, "");
const int s2 = sizeof(&"aa");
_Static_assert(s2 == sizeof(void*), ""); // fails
```

Additionally, the following invalid code is now accepted:
```
char(**s1)[3] = &(&"aa");
char(***s2)[3] = &(&(&"aa"));
// and so on
```

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

--- Comment #4 from Steven Dwy <me@yoplitein.net> ---
(In reply to Steven Dwy from comment #3)
> Additionally, the following invalid code is now accepted:
> ```
> char(**s1)[3] = &(&"aa");
> char(***s2)[3] = &(&(&"aa"));
> // and so on
> ```

My bad, seems to actually be from the fix for issue 22070.

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

--- Comment #5 from Dlang Bot <dlang-bot@dlang.rocks> ---
@Yoplitein created dlang/dmd pull request #14027 "Amend prior fix for issue 22877" mentioning this issue:

- Amend prior fix for issue 22877

  Aligns ImportC's treatment of string literals with C11 by typing them as
static arrays
  Also fixes `typeof(&"")` returning string length instead of pointer size

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

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

--- Comment #6 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #14027 "Amend prior fix for issue 22877" was merged into master:

- ede0d4a4c5d7df7f6f54d20af0c06b221a79f875 by Steven Dwy:
  Amend prior fix for issue 22877

  Aligns ImportC's treatment of string literals with C11 by typing them as
static arrays
  Also fixes `typeof(&"")` returning string length instead of pointer size

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

--
May 01, 2022
https://issues.dlang.org/show_bug.cgi?id=22877

--- Comment #7 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright updated dlang/dmd pull request #14049 "fix Issue 23057 - importC: dmd segfault on invalid syntax" mentioning this issue:

- Amend prior fix for issue 22877

  Aligns ImportC's treatment of string literals with C11 by typing them as
static arrays
  Also fixes `typeof(&"")` returning string length instead of pointer size

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

--
May 02, 2022
https://issues.dlang.org/show_bug.cgi?id=22877

--- Comment #8 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ljmf00 updated dlang/dmd pull request #14058 "fix(backend): define XMM load/store codegen for short type variants" mentioning this issue:

- Amend prior fix for issue 22877

  Aligns ImportC's treatment of string literals with C11 by typing them as
static arrays
  Also fixes `typeof(&"")` returning string length instead of pointer size

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

--
May 09, 2022
https://issues.dlang.org/show_bug.cgi?id=22877

--- Comment #9 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright updated dlang/dmd pull request #14044 "fix Issue 23058 - importC: cannot take address inside multi-dimension…" mentioning this issue:

- Amend prior fix for issue 22877

  Aligns ImportC's treatment of string literals with C11 by typing them as
static arrays
  Also fixes `typeof(&"")` returning string length instead of pointer size

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

--
« First   ‹ Prev
1 2