Bug 21055 – core.stdc.stdarg is not @nogc

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-07-18T13:25:46Z
Last change time
2020-08-04T22:57:06Z
Keywords
betterC, pull
Assigned to
No Owner
Creator
Dennis

Comments

Comment #0 by dkorpel — 2020-07-18T13:25:46Z
``` import core.stdc.stdarg; import core.stdc.stdio; extern(C) void foo(const(char)* format, ...) @nogc { va_list vl; va_start(vl, format); vprintf(format, vl); va_end(vl); } void main() { foo("ten = %d", 10); } ``` onlineapp.d(6): Error: @nogc function onlineapp.foo cannot call non-@nogc function core.stdc.stdarg.va_start!(const(char)*).va_start onlineapp.d(8): Error: @nogc function onlineapp.foo cannot call non-@nogc function core.stdc.stdarg.va_end This makes no sense, the C code does not need a GC so neither should D. On top of core/stdc/stdarg.d it says: //@nogc: // Not yet, need to make TypeInfo's member functions @nogc first That was added when stdarg looked like this: https://github.com/dlang/druntime/blob/8c07338efe375f8ba4b687c8e9085d4ba686963a/src/core/stdc/stdarg.d Currently I see no trace of TypeInfo anymore.
Comment #1 by dlang-bot — 2020-07-18T13:30:00Z
@dkorpel created dlang/druntime pull request #3163 "Fix issue 21055 - core.stdc.stdarg is not nogc" fixing this issue: - fix issue 21055 - core.stdc.stdarg is not nogc https://github.com/dlang/druntime/pull/3163
Comment #2 by dlang-bot — 2020-08-04T22:57:06Z
dlang/druntime pull request #3163 "Fix issue 21055 - core.stdc.stdarg is not nogc" was merged into master: - b4533696583f82974201bece103ff338cf9e0272 by dkorpel: fix issue 21055 - core.stdc.stdarg is not nogc https://github.com/dlang/druntime/pull/3163