Thread overview
[Issue 23714] compilable/testcstuff1.c:213:1: error: static assertion failed: u'ab' == 0x610062
Feb 15, 2023
Iain Buclaw
Feb 27, 2023
Iain Buclaw
Dec 02, 2023
Walter Bright
Dec 02, 2023
Iain Buclaw
Dec 03, 2023
Walter Bright
Dec 03, 2023
Dlang Bot
Dec 05, 2023
Dlang Bot
February 15, 2023
https://issues.dlang.org/show_bug.cgi?id=23714

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, ImportC
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=23689
         Depends on|                            |23689


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=23689
[Issue 23689] ImportC: C tests in the testsuite are not valid C
--
February 27, 2023
https://issues.dlang.org/show_bug.cgi?id=23714

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

--
December 02, 2023
https://issues.dlang.org/show_bug.cgi?id=23714

Walter Bright <bugzilla@digitalmars.com> changed:

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

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
It's a warning, as most C compilers will allow multi-character character constants as an extension.

--
December 02, 2023
https://issues.dlang.org/show_bug.cgi?id=23714

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to Walter Bright from comment #1)
> It's a warning, as most C compilers will allow multi-character character constants as an extension.
The static assert fails though, which it doesn't with importC. It might suggest we're following a subtly different semantic than what C does, which may or may not be problematic in real-life projects.

--
December 03, 2023
https://issues.dlang.org/show_bug.cgi?id=23714

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
C11 6.4.4.4-11 says:

"a wide character constant prefixed by the letter u or U has type char16_t or
char32_t, respectively, unsigned integer types defined in the
<uchar.h> header."

clang gives an error for u'ab', gcc gives a warning and produces the value 0x62 for it. I suggest the best solution for ImportC is to produce the value 0x62, not 0x610062.

--
December 03, 2023
https://issues.dlang.org/show_bug.cgi?id=23714

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 #15878 "fix Issue 23714 - compilable/testcstuff1.c:213:1: error: static asser…" fixing this issue:

- fix Issue 23714 - compilable/testcstuff1.c:213:1: error: static assertion failed: u'ab' == 0x610062

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

--
December 05, 2023
https://issues.dlang.org/show_bug.cgi?id=23714

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 #15878 "fix Issue 23714 - compilable/testcstuff1.c:213:1: error: static asser…" was merged into master:

- 77583919dd5e7ee3ce29d823a5b9c050956f6152 by Walter Bright:
  fix Issue 23714 - compilable/testcstuff1.c:213:1: error: static assertion
failed: u'ab' == 0x610062

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

--
December 15, 2023
https://issues.dlang.org/show_bug.cgi?id=23714
Issue 23714 depends on issue 23689, which changed state.

Issue 23689 Summary: ImportC: C tests in the testsuite are not valid C https://issues.dlang.org/show_bug.cgi?id=23689

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

--