D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21055 - core.stdc.stdarg is not @nogc
Summary: core.stdc.stdarg is not @nogc
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: betterC, pull
Depends on:
Blocks:
 
Reported: 2020-07-18 13:25 UTC by Dennis
Modified: 2020-08-04 22:57 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dennis 2020-07-18 13:25:46 UTC
```
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 Dlang Bot 2020-07-18 13:30:00 UTC
@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 Dlang Bot 2020-08-04 22:57:06 UTC
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