Bug 22411 – importC: Error: cannot implicitly convert expression of type 'const(char*)' to 'char*'

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-10-17T17:09:07Z
Last change time
2021-10-21T21:39:40Z
Keywords
ImportC, pull, rejects-valid
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2021-10-17T17:09:07Z
--- extern char * const errmsg[10]; void test() { char *msg = errmsg[6]; }
Comment #1 by ibuclaw — 2021-10-17T17:10:37Z
This code is a warning is gcc, but not an error.
Comment #2 by dlang-bot — 2021-10-17T17:28:31Z
@ibuclaw created dlang/dmd pull request #13186 "fix Issue 22411 - importC: Error: cannot implicitly convert expression of type 'const(char*)' to 'char*'" fixing this issue: - fix Issue 22411 - importC: Error: cannot implicitly convert expression of type 'const(char*)' to 'char*' https://github.com/dlang/dmd/pull/13186
Comment #3 by dlang-bot — 2021-10-19T18:06:21Z
dlang/dmd pull request #13186 "fix Issue 22411 - importC: Error: cannot implicitly convert expression of type 'const(char*)' to 'char*'" was merged into stable: - 0b71439a16714679fa7eb26751fd55cedb8017a3 by Iain Buclaw: fix Issue 22411 - importC: Error: cannot implicitly convert expression of type 'const(char*)' to 'char*' https://github.com/dlang/dmd/pull/13186
Comment #4 by dlang-bot — 2021-10-21T21:39:40Z
dlang/dmd pull request #13209 "Merge stable into master" was merged into master: - ba950023e142b580ac2cd844e83a0bcb8fc73204 by Iain Buclaw: fix Issue 22411 - importC: Error: cannot implicitly convert expression of type 'const(char*)' to 'char*' (#13186) The autotester failure is a spurious one: https://issues.dlang.org/show_bug.cgi?id=22350 https://github.com/dlang/dmd/pull/13209