Bug 23711 – compilable/testcstuff1.c:63:1: error: invalid use of restrict

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2023-02-15T16:23:56Z
Last change time
2023-02-22T00:06:11Z
Keywords
accepts-invalid, ImportC, pull
Assigned to
No Owner
Creator
Iain Buclaw
Depends on
23689
See also
https://issues.dlang.org/show_bug.cgi?id=23689

Comments

Comment #0 by ibuclaw — 2023-02-15T16:23:56Z
When compiling the test with `gcc -std=c11 -fsyntax-only` compilable/testcstuff1.c:63:1: error: invalid use of ‘restrict’ 63 | _Static_assert(sizeof(const restrict volatile char volatile restrict const) == 1, "ok"); | ^~~~~~~~~~~~~~ Test content: ``` _Static_assert(sizeof(const restrict volatile char volatile restrict const) == 1, "ok"); ```
Comment #1 by ibuclaw — 2023-02-15T16:42:28Z
Another test that fails to compile. compilable/testcstuff1.c:260:5: error: invalid use of ‘restrict’ 260 | int (* const volatile restrict fp2)(void); | ^~~ ``` int (* const volatile restrict fp2)(void); ```
Comment #2 by ibuclaw — 2023-02-15T16:44:33Z
And another compilable/testcstuff1.c:278:5: error: invalid use of ‘restrict’ 278 | restrict int ri; | ^~~~~~~~ From the same function, bundling both this and the previous together. ``` void test2() { int (* const volatile restrict fp2)(void); restrict int ri; } ```
Comment #3 by dlang-bot — 2023-02-20T07:13:20Z
@WalterBright created dlang/dmd pull request #14898 "fix Issue 23711 - compilable/testcstuff1.c:63:1: error: invalid use o…" fixing this issue: - fix Issue 23711 - compilable/testcstuff1.c:63:1: error: invalid use of restrict https://github.com/dlang/dmd/pull/14898
Comment #4 by dlang-bot — 2023-02-22T00:06:11Z
dlang/dmd pull request #14898 "fix Issue 23711 - compilable/testcstuff1.c:63:1: error: invalid use o…" was merged into master: - f4a7bf192ee230fcf352fa8330ab271fd7f1eeec by Walter Bright: fix Issue 23711 - compilable/testcstuff1.c:63:1: error: invalid use of restrict https://github.com/dlang/dmd/pull/14898