www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21055] New: core.stdc.stdarg is not nogc


          Issue ID: 21055
           Summary: core.stdc.stdarg is not  nogc
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: betterC
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: dkorpel live.nl

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);

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:

Currently I see no trace of TypeInfo anymore.

Jul 18 2020