www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15053] New: Runtime.cArgs not nogc

https://issues.dlang.org/show_bug.cgi?id=15053

          Issue ID: 15053
           Summary: Runtime.cArgs not  nogc
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: me philpax.me

When using  nogc code and/or C standard library functions, accessing the
standard C main arguments is useful. Unfortunately, cArgs is not  nogc:

---
import core.stdc.stdio;
import core.runtime;

 nogc:
void main()
{
    // NG
    printf("%s\n", Runtime.cArgs.argv[0]);
}
---

--
Sep 12 2015